Sunday, February 08, 2009

Tips & Tricks: How to use IIS as your local Web Development Server...

When you create a new web application project (WAP) by going to File --> New --> Project --> Web Application Project then the default Web server used is "Visual Studio Development Server"  (fondly named as 'Cassini')...

Cassini does not require you to run as a local administrator on the dev box and hence is something which is preferred by a lot of enterprises.  At the same time Cassini is not an exact representation of how your production web server will look like.  As your production web server is typically an IIS Web Server, Visual Studio also allows you to use IIS as your development web server...

Although many operations related to IIS require you to be a local administrator of your box...  If you would like to use IIS as your development web server than you need to make sure you are running Visual Studio in an administrator mode.

After you do so, you can right click on your WAP --> Click Properties and open the Property pages of the project.  Now you can navigate to the "Web" tab of the property page and select "IIS Web Server" as shown below...

image

You can then click the "Create Virtual Directory" button and your IIS application + VDir will be created... Going forward when you debug or run the Web Application from Visual Studio then your application should use all of the IIS Settings that you configure using IIS Management Console (Start --> Run --> Inetmgr)...

Note: Do note that Visual Studio uses IIS Metabase Compatibility mode to actually access IIS functions so you need to go to Start --> Control Panel --> Programs & Features --> Add or Remove Windows Components / Turn Windows features on or off and make sure below features are enabled:

image

Hope this helps...

6 comments:

affordable web design said...

Thanks for sharing the links. These links really helps in my design. Appreciate it. Great blog!

Richard said...

Thanks for sharing those tips, I'll try this out and hopefully see the same results. More power and keep up the good work!

San Diego seo

Vishal R Joshi said...

Afforbable web Deisgn and Richard, glad to see that this is helping out...
-Vishal

hosting boy said...

Great links you have shared. Very helpful too.....

Anonymous said...

Great post!!!

Anonymous said...

For the sake of completeness for others, the following link explains how to work with the local IIS without having to create a new virtual directory. http://stackoverflow.com/questions/4436942/is-it-possible-to-test-asp-net-mvc-being-developed-using-visual-studio-on-local