Debugging on Vista with IIS7 and VS2005 [modified]
-
I'm using VS 2005 on a 64 bit version of Windows Vista. I have installed IIS 7, and all of the IIS6 compatability options. I am unable to debug a web application by running it from VS2005 when it is running under IIS7. (When running under the ASP.NET development server tool it debugs fine.) I am able to attach to the relevant process though and debug it fine that way. What could be causing this? The application is not under inetpub\wwwroot, but I've done a test from the default location and it gives the same error:
--------------------------- Microsoft Visual Studio --------------------------- Unable to start debugging on the web server. An authentication error occurred while communicating with the web server. Please see Help for assistance. --------------------------- OK Help ---------------------------
Steps I've taken include: - Ensuring Windows Authentication is enabled for the application in IIS7. - VS2005 is running as an Administrator, and UAC is off anyway. - Granting Everyone full rights to the source directory. Remember, I can still debug the ASP.NET worker process if I attach to it directly. The error message isn't very helpful because web searches indicate it is a standard error for all sorts of problems. Does anyone else have any pointers because having to attach to the process each time is driving me mad. -- modified at 14:02 Tuesday 12th December, 2006 Richard found the fix for my problem - I needed to add localhost to my trusted sites.
Ðavid Wulff What kind of music to programmers listen to?
Join the Code Project Last.fm group | dwulff
I'm so gangsta I eat cereal without the milk -
I'm using VS 2005 on a 64 bit version of Windows Vista. I have installed IIS 7, and all of the IIS6 compatability options. I am unable to debug a web application by running it from VS2005 when it is running under IIS7. (When running under the ASP.NET development server tool it debugs fine.) I am able to attach to the relevant process though and debug it fine that way. What could be causing this? The application is not under inetpub\wwwroot, but I've done a test from the default location and it gives the same error:
--------------------------- Microsoft Visual Studio --------------------------- Unable to start debugging on the web server. An authentication error occurred while communicating with the web server. Please see Help for assistance. --------------------------- OK Help ---------------------------
Steps I've taken include: - Ensuring Windows Authentication is enabled for the application in IIS7. - VS2005 is running as an Administrator, and UAC is off anyway. - Granting Everyone full rights to the source directory. Remember, I can still debug the ASP.NET worker process if I attach to it directly. The error message isn't very helpful because web searches indicate it is a standard error for all sorts of problems. Does anyone else have any pointers because having to attach to the process each time is driving me mad. -- modified at 14:02 Tuesday 12th December, 2006 Richard found the fix for my problem - I needed to add localhost to my trusted sites.
Ðavid Wulff What kind of music to programmers listen to?
Join the Code Project Last.fm group | dwulff
I'm so gangsta I eat cereal without the milkDavid, not sure if these help or hinder... According to this http://weblogs.asp.net/scottgu/archive/2006/09/19/Tip_2F00_Trick_3A00_-Using-IIS7-on-Vista-with-VS-2005.aspx[^], "Running VS 2005 with "elevated" privledges won't be required if you use the built-in VS 2005 Web-Server (since it has reduced privledges already). It is only required when connecting and running/debugging with IIS locally." And according to http://www.brianpeek.com/blogs/archive/2006/09/09/499.aspx[^] " 1) In the "Internet Options" control panel, go to the Security tab. Add "http://localhost" to your list of "Trusted Sites" 2) Again, for "Trusted Sites", clilck the "Custom Level..." button. Change the value of User Authentication to "Automatic login with current username and password". 3) In the new IIS manager, ensure that the web application directory is both: a) in the "Classic .NET AppPool". b) has "Windows Authentication" enabled in the Authentication section. "
-
David, not sure if these help or hinder... According to this http://weblogs.asp.net/scottgu/archive/2006/09/19/Tip_2F00_Trick_3A00_-Using-IIS7-on-Vista-with-VS-2005.aspx[^], "Running VS 2005 with "elevated" privledges won't be required if you use the built-in VS 2005 Web-Server (since it has reduced privledges already). It is only required when connecting and running/debugging with IIS locally." And according to http://www.brianpeek.com/blogs/archive/2006/09/09/499.aspx[^] " 1) In the "Internet Options" control panel, go to the Security tab. Add "http://localhost" to your list of "Trusted Sites" 2) Again, for "Trusted Sites", clilck the "Custom Level..." button. Change the value of User Authentication to "Automatic login with current username and password". 3) In the new IIS manager, ensure that the web application directory is both: a) in the "Classic .NET AppPool". b) has "Windows Authentication" enabled in the Authentication section. "
Richard A. Abbott wrote:
In the "Internet Options" control panel, go to the Security tab. Add "http://localhost" to your list of "Trusted Sites"
That one step was all I needed, thank you Richard! :cool: :rose:
Ðavid Wulff What kind of music to programmers listen to?
Join the Code Project Last.fm group | dwulff
I'm so gangsta I eat cereal without the milk -
Richard A. Abbott wrote:
In the "Internet Options" control panel, go to the Security tab. Add "http://localhost" to your list of "Trusted Sites"
That one step was all I needed, thank you Richard! :cool: :rose:
Ðavid Wulff What kind of music to programmers listen to?
Join the Code Project Last.fm group | dwulff
I'm so gangsta I eat cereal without the milkTo explain why you need to do this: IIS requires that users of the DEBUG verb are authenticated using Windows Authentication. IE 7.0 will only do Windows Authentication for trusted sites and for Intranet sites. If you're not on a domain, IE 7.0 doesn't use the Intranet zone, it's all treated as 'The Internet'. It isn't smart enough to convert 'localhost' or any other name which maps to the local machine to 'Local Machine zone' (and you might not want it to anyway since that would invoke Local Machine Zone Lockdown). The setting can be tweaked using the Security tab. Click Custom Level for The Internet, then under User Authentication, Logon, select 'Automatic logon using current username and password' rather than 'Automatic logon in Intranet zone only'. Obviously this setting is not recommended.
Stability. What an interesting concept. -- Chris Maunder
-
To explain why you need to do this: IIS requires that users of the DEBUG verb are authenticated using Windows Authentication. IE 7.0 will only do Windows Authentication for trusted sites and for Intranet sites. If you're not on a domain, IE 7.0 doesn't use the Intranet zone, it's all treated as 'The Internet'. It isn't smart enough to convert 'localhost' or any other name which maps to the local machine to 'Local Machine zone' (and you might not want it to anyway since that would invoke Local Machine Zone Lockdown). The setting can be tweaked using the Security tab. Click Custom Level for The Internet, then under User Authentication, Logon, select 'Automatic logon using current username and password' rather than 'Automatic logon in Intranet zone only'. Obviously this setting is not recommended.
Stability. What an interesting concept. -- Chris Maunder
Thanks for that Mike, it makes perfect sense with hindsight. I will leave my Internet zone alone though - there's no need me for me to change that.
Ðavid Wulff What kind of music to programmers listen to?
Join the Code Project Last.fm group | dwulff
I'm so gangsta I eat cereal without the milk