<a href="http://www.micropoll.com/akira/mpview/585320-168921">Click Here for Poll</a><a href="http://www.questionpro.com" title="online surveys">Online Survey</a><BR> | <a href="http://www.micropoll.com" title="Website Polls">Website Polls</a><BR> | <BR><a href="http://www.micropoll.com/akira/MicroPoll?mode=html&id=168921">View MicroPoll</A></div>

VB.NET and Silverlight!

Read now >

Windows Mobile Development Thoughts

Read now >

ADVERTISEMENT
View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.
ADVERTISEMENT

 

ADVERTISEMENT
Using the Visual Studio Built-in Web Server from the Command Line
By John Mueller

Rate This Article: Add This Article To:

Using the Visual Studio Built-in Web Server from the Command Line
( Page 1 of 2 )

Ooooh, we love those undocumented utilities! Developers love the new built-in Web server; they'll like it even more at the command line.

Everyone should take time to browse the command line from time-to-time. You never know what you'll find lurking about in the recesses of all those folders on your system. The other day, I was exploring the .NET Framework 2.0 folder, \WINDOWS\Microsoft.NET\Framework\v2.0.50727. I found all of the utilities I expected — and one that I didn't.

It was a new application, named WebDev.WebServer.EXE. Other than the very odd filename, anyone who's worked with Visual Web Developer will instantly understand the implications of that application. This program lets you execute Web applications from within Visual Web Developer and Visual Studio 2005 using the built-in Web server.

I can't stress enough the importance of this particular application. The built-in Web server is one of the best ideas that Microsoft has had in a long time. You can create a local Web site using a folder containing Web files of any type, not just ASP.NET files. For example, I tested it with my personal Web site. It came right up in the browser using the built-in Web server.

While that's kind of cool, you should know the whole story before you decide about this particular .NET Framework 2.0 feature. No one but you can access the built-in Web server. First, it can use odd port numbers instead of the more common port 80. Also, Microsoft didn't design the server for outside access. Consequently, you can run your personal server without fear of prying eyes.

Uses for the Built-in Web Server

The most obvious use for the built-in Web server is to aid in Web site development; the task for which Microsoft originally intended it. The advantage to the developer is that it's possible to test an application on any machine that has the .NET Framework 2.0 installed. You can test your application without having Visual Web Developer or Visual Studio 2005 installed. In short, the test environment has now expanded to include any machine, simply by using a command line utility.

It's also possible to use this utility for creating demonstrations. The only thing you need to distribute is the Web site on a CD. With the addition of a batch file, the CD can start the Web server, open a browser, and display the demonstration. Some users might even think that they're using the Internet, when, in reality, everything appears on their local machine. This approach means that you don't actually need a Web site anymore to run a demonstration. The local Web server can display the demo without any Internet connection at all.

Users can also benefit from local Web-based applications that execute significantly faster than can any Internet application. The Web-based application can still use Internet resources, as long as the user as an Internet connection, but the point is that the main application execution occurs on the local machine. This approach has several benefits for your company, too. Local execution from an inaccessible Web server tends to reduce security problems immensely. In addition, local execution of most or all of the code means that users don't hit your company's server as hard with application requests.



 
 
>>> More Using Microsoft Visual Studio Articles          >>> More By John Mueller