繁体   English   中英

从命令行打开Visual Studio网站(不是解决方案)

[英]Open a visual studio website (not solution) from the command line

我使用Visual Studio创建了一个控制台应用程序,以针对我们的网站运行补丁文件。

应用补丁后,我要在Visual Studio中打开网站并运行它。

我的问题是我拥有的站点不是“项目”或“解决方案”。 我尝试使用以下命令,但是它将打开该网站作为解决方案,并添加了许多.vs文件,但无法运行。

(devenv / command \\“ File.OpenWebSite \\” project.rootFolder);

基本上我要问的是; 有没有办法打开网站而不打开它作为解决方案? 从我可以看到的File.OpenWebsite应该做我想要的...

任何帮助将是巨大的,在此先感谢

如果您能够使用Internet浏览器浏览到该网站,则可以使用System.Process.Start()来打开它:

using System;
using System.Diagnostics;

 string browserPath = @"C:\Program Files\Mozilla Firefox\firefox.exe"; //or whatever browser you use
 string website = @"google.com"; //replace with your actual website

 Process.Start(browserPath, website);

在程序末尾添加它,它应该可以正常工作。 如果您的网站只是一个文件(而不是网址),则将google.com替换为网站文件的完整文件路径(.html等)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM