Sunday 8 April 2007

Visual Studio 2003 Web Debugging on Vista

We are trying to move our development setups onto new equipment running Vista. I know we could use Virtual PC which is Microsoft's suggestion, but we all use laptops and the disk overhead would be a pain.

Anyway after much messing around and reading of other peoples Blog's here's how I made it work.

Firstly setup your user account as a local admin on the Vista machine and switch off the dreaded "user account control". Obviously you need to know what your doing when if you are going to do this, but I'm assuming most developers understand a little about computer security. This step seems essential to get Visual Studio 2003 working.

Next make sure IIS is installed and you have selected the "IIS 6.0 management compatibility option".




After this we installed VS2003, it will warn you about the lack of Frontpage Extensions, skip the warning.

Once VS is installed you need to ensure your user account is included in the Debugger User group.

Next I followed the steps outlined in the following Blog

http://blogs.iis.net/brian-murphy-booth/archive/2007/03/09/how-to-setup-asp-net-v1-1-visual-studio-net-2003-projects-on-iis7-vista.aspx



However once this was completed we needed to change a few more settings before we could get IIS working with Visual Studio. The first was to adjust ISAPI and CGI restrictions which had removed access to ASP 1.1. We had been getting the somewhat cryptic error



"HTTP Error 404.2 - Not Found
Description: The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server."

This occurred when attempting to run any ASP 1.1 web applications.


To achieve this go into IIS 7.0 manager and select your server, which is the top level on the left hand side. Select ISAPI and CGI restrictions and ensure ASP v1.1 has the restriction set to Allowed.





Finally we created a new 1.1 web application via Visual Studio, thus creating a new virtual directory in IIS. At this stage you should just need to setup the resulting virtual directory correctly in IIS.

To achieve this involved editing ASP and Authentication settings. Inside ASP properties I edited the debugging section to allow server and client side debugging. In Authentication I allowed Windows authentication.



Its worth noting that some of the options in the IIS7 manager put entries in the web.config which are not compatible with the 1.1 run time. For example I changed the default page and this put entries in the web.config which resulted in server errors.


IIS 7 looks good, but there is clearly a lot of new stuff to learn, and some worrying incompatibilities introduced by the new Vista security model.

In summary it appears possible to use IIS 7 and VS 2003 to build and more importantly debug web applications. The next step is to load up our eCommerce application in VS2003 and look at stability and speed before we start to use Vista to write production code. I'll post again once we have some real world experience.


Neil

12 comments:

Anonymous said...

Thanks for sharing this. I have been forced (via a new notebook) to use Vista, while I need to keep developing in VS.NET 2003. By following your steps I managed to get it going. It really is outrageous that Microsoft has treated its users so poorly. I have lost almost all confidence in them as a result.

Anonymous said...

When you run the SP1 update, did it actually change the version on the file? My install says the SP1 ran OK, but the version is still the same.

Neil McQuillan said...

RE: SP1 - Are you using VS 2003. If so I'm not 100 % sure we installed SP1. What is your file version?

Anonymous said...

I went thru the step outlied and When I went to open a new project, I received the folowing error.
The web server reported the following error when attempting to create or open the Web project located at the following URL:
'http://localhost/WebApplication1'.'HTTP/1.1.500 Internal server Error'

Can you give me any help on this?
dleaderach@aol.com

Anonymous said...

What version of Vista did you use to get this working? Home, Home Premium, Business or Ultimate?

Neil McQuillan said...

Business, can't see why this wouldn't work on all versions with the possible acception of home.

Anonymous said...

Please call me Bass.

I tried all the steps. However, when I create a new 2003 project, the IDE throws "Visual Studio.NET cannot create or open the application. Web site 'http://localhost/mytest' not started on this Web server."

Then, a windows popup appears and says "IIS Worker Process stopeed working and was closed. A problem caused the application to stop working correctly. Windows will notify you if a solution is available."

I believe I did everything right. ISAPI and CGI is allowed. Ran VS2003 as admin. I am admin and is a member of debugger user group. mscorsvr.dll's version is 1.1.4322.573 (which should be OK). I ran aspnet_regiis -ir -enable successfully after installing vs2003.

I'm running Vista Ultimate (upgraded from Vista Home Basic using OEM cd).

What have I done or did not do? Thanks.

Anonymous said...

for anyone having issues with .NET 1.1 do the following:

Follow the guide on this blog, follow the link and setup IIS7 as mentioned in Brian's blog.

Now to make life easier I did the following:

Created a new web site under the Web Sites folder in IIS7, I made one for .NET 1.1 (called dev11) and one for .NET 2.0 (called dev20).

When I created dev11 I assigned the pool as ASP.NET 1.1 Pool which ensures .NET 1.1 apps will run under this web site. For .NET 2.0 I assigned Classic ASP.NET. Finally when you publish applications via VS.NET 2003 they will not get created by default so when you go to debug them they will error however the site will publish correctly.

You need to load up IIS7, browse to your .NET 1.1 web site and create a new application under this site, give it an alias and point it to your published site e.g. if your sites sit in a folder called C:\mynet11sites\debugtest then you would point to that.

IIS7 will add some .NET 2.0 stuff in that you don't need.

Firstly select your .NET 1.1 web site in IIS7 (not your applications) and double-click ISAPI Filters. In here you will see the ASP.NET 2.0 filter, we don't want this so create a new filter and point it to the .NET 1.1 folder (v1.1.4322 or something) and then remove the .NET 2.0 filter.

Next double-click HTTP Handlers and remove any entries that have "2.0" in their name - these are for ASP.NET 2.0 so we don't need these.

Then finally setup your application to allow debugging as per the instructions in this blog and your all set to go.

Its a pain to do this each time you create an application but it works which matters.

If you have the memory and hard disk space then I recommend getting VMWare6 (Virtual PC is crap) and build a Windows 2003 Server to deploy and test on, much safer and you will not have any doubts about your results.

Adios,

Fz

rmcubed said...

As far as I can see you do not need UAC disabled providing you are an admin and you run at admin: caution haven't tried debugging classic ASP without UAC turned on.

Unknown said...

Could you explain more from this sentence "To achieve this involved editing ASP and Authentication settings...." . It kind of lost me from there. Feels like I'm at one more step away...

Anonymous said...

Anyone following this will understand that it is a minefield... I followed these threads carefully (big thanks to all that took time out to document their journey) I was about to give up and consider a remote debugging option when I noticed in IIS7 when I clicked on the IIS7 applications I had set up mirroring the dev11 guidelines posted by FZ... when I clicked on the 'Authentication' icon the 'Windows Authentication' was disabled. Once I enabled this everything worked for me. Hope this helps someone. I stumbled on this by accident so I cant offer an explanation sorry, but it works for me. Good Luck

Anton

Anonymous said...

Hello
I am using vista home premium and I have installed visual studio 2003 and I have gone through all your steps, and I have checked .net version it's 1.1.4322.2407, Set ISAPI restriction to allowed but still getting this error

Error while trying to run project: unable to start debugging on the web server. you do not have permissions to debug the server.
Verify that you are a member of the 'Debugger User' group on the server


I have no idea what to do now

please please help me

waiting for your kind rep.

have a nice day

thanks