How to run WebDevServer from a .sln file without opening Visual Studio 2008

Is there a way to start WebDevServer (Visual Web Development Server) by transferring 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 provide them to several browsers for cross-browser testing. I disagree with configuring IIS (Visual Web Dev server is SO LIGHT-WEIGHT, which is Cassini). Please advise. Thank!

+3
source share
2 answers

Yes, you can run your application without opening Visual Studio from the file system mode. Refer to the code snippet below that 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));
+1
source

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

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

It is specially designed to support your requirements.

+1
source

Source: https://habr.com/ru/post/1732962/


All Articles