Tuesday, February 20, 2007

VSDotnet IDE 2005 making use of IIS instead of development webserver

How to use IIS as the default web server instead of inbuilt ASP.Net development web server
When you create a new web project in VS dot net IDE 2005, by default it uses the inbuilt ASP.Net development web server for debugging and running,

So the URL will be something like,
http://localhost:2500 or a dynamic port,

This is actually the internal development web server. But for developers who are familiar with using IIS this may actually be a head ache. Also if you are using port 80 to code certain applications or using AJAX with 80 port then it may be tough to debug using fiddler or in general to stop and restart. So it is better to use IIS.

Listed below are the series of steps which you can easily do to change it to use IIS,
1) Create a virtual directory on IIS and point it to the folder where the source code resides, for example I use D:\drive instead of C:\inetpub\wwwroot, so i create a Virtual directory called "WebSite1" and point it to D:\proejcts\dotnet\website1\ = the folder where the sln file and the vbproj or csproj resides.

2) Right click on the virtual directory tab and go to properties in IIS and click on ASP.Net tab, in the dropdown change the dot net version from 1.1 to 2.0

3) Then open your VS dot net solution file and right click on your project >> go to property pages >> click on start options to see a screen like the one shown below,

In the above screen, select Use Custom server, Base URL: http://localhost/website1
Now try debug >> start without debugging, you will be using IIS to render the page. Though this is simple it takes few minutes to ponder this setting.

1 comment:

BalaIvesian said...

Hi Prashant,

Today Only I have visited your site.Really it is very very useful for the guys like me in MS technologies especially latest .NET implementations.Now only I am felling I have wasted my life a lot without concentrating more on latest technology like you guys.But to be frank with you I am very much confused now like in which version of .NET framework I have to concentrate more because I know .NET 1.1 well and I worked on the same only.So please let me know whether I have to start with 2.0 or directly with .NET 3.0.I know your are very busy but please let me know from where to start and which link/material is good and cover all the topics for ASP.NET and please let me know which language(C# / VB.Net) is preferable as code behind and from where to start to become a good programmer.

Your suggestions will really help me to get a better gorwth.

Thanks in advance.

Balaji.T ( Ex Trainer for ur easy identification)
Ivesia solutions