开发者

How do I start WebDevServer from a .sln file without opening Visual Studio 2008

Is there a way to start WebDevServer (Visual Web Development Server) by passing in the .sln file without actually opening Visual Studio 2008? I am a JavaScript developer and I work in a client project and I want to save the memory overhead consumed by VS and give it t开发者_JAVA技巧o multiple browsers for cross-browser testing. I am hesitant with setting up IIS (Visual Web Dev server is SO LIGHT-WEIGHT being Cassini). Please advice. Thanks!


Yes, you can run your application without opening Visual studio from File system mode. Refer the below code snippet which is provided for VS 2008.

string randomportnumber = string.Format("{0}", new Random().Next(0x3e9, 0x4e20));
string applicationpath = @"c:\work\yourwebapplication";

 Process process = new Process();
                process.StartInfo.FileName = "WebDev.WebServer.EXE"
                process.StartInfo.WorkingDirectory = @"C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\";
                process.StartInfo.Arguments = string.Format("/port:{0} /path:\"{1}\" /vpath:\"/{2}\"", randomportnumber, applicationpath, string.Empty);

                process.StartInfo.CreateNoWindow = true;
                process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

                process.Start();
                Thread.Sleep(new TimeSpan(0, 0, 10));

                process.StartInfo.CreateNoWindow = true;
                process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

                Process.Start(string.Format("http://localhost:{0}/default.aspx", randomportnumber));


No, you cannot start webdev or any other server from an .sln outside of the visual studio context.

Yes, you can start webdev from the command line by passing the directory of your application, but you might find CassiniDev quite useful in your workflow.

It is specifically designed to support your requirements.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜