Welcome to MSDN Blogs Sign in | Join | Help

Welcome to The Metaverse

Navigating the service-oriented, identity aware metaverse

News

  • Disclaimer:
    The content of this blog are my own personal opinions and do not necessarily represent Microsoft's position, commitments or strategy. In addition, my thoughts and opinions often change, and as a weblog is intended to provide a semi-permanent point in time snapshot you should not consider out of date posts to reflect my current thoughts and opinions.




    Add to Technorati Favorites
Public Hotfix Patch Available for Debugging ASP.NET on IIS7 - ScottGu's Blog

Ever since the launch of ASP back in the late 90's, I've wanted to have integrated debugging support so that when developing websites and services using Visual Studio, I can hit F5 and walk through my project's code. Getting ASP, IIS and Visual Studio configured juuuuuuust right was a real art-form, particularly back in the IIS4 days.

When I was building the sample for the "How to configure IIS7 to support Information Cards" webcast I recently published, I was a little perplexed to find that IIS7 and ASP.NET didn't seem to support F5 debugging either. While investigating the issue, I stumbled across a support article which highlighted the fact that my site had to be configured to support Windows Integrated Authentication and that I had to wave a sacrificial chicken* over the PC at just the right moment.

Whilst I managed to get debugging configured properly, I always kinda wondered if F5 was ever going to be a well-supported ASP.NET/IIS scenario.

Well, I was much heartened to find a post from Scott Guthrie that announced a hot-fix to resolve this issue and to quickly enable F5 debugging for ASP.NET/IIS apps :) He was also kind enough to discuss why Windows Authn is required by the Visual Studio debugger:

[From: Public Hotfix Patch Available for Debugging ASP.NET on IIS7 - ScottGu's Blog]
 

People who use VS 2005 to debug ASP.NET applications running in IIS7 on Windows Vista can encounter one of the following error messages when they press F5 to auto-attach the debugger in the IDE:

  • "An authentication error occurred while communicating with the web server."
  • "Debugging failed because integrated Windows authentication is not enabled."
  • "Authentication error occurred while communicating with the web server.  Try disabling 'Digest authentication'"

The above errors occur because of the way that VS 2005 looks up the Process ID of the IIS7 worker process that ASP.NET is running within.  Specifically, when you use F5 to "auto attach" the debugger with Visual Studio it sends an HTTP request to ASP.NET using Windows Authentication to retrieve the worker process details.  This works fine if you have Windows Authentication enabled on your web-server, and are using Windows Authentication as the primary authentication method for your web application.  It runs into problems, though, in a couple of circumstances:

  1. If you have forms-auth enabled in ASP.NET and are running in "integrated mode" on the IIS7 web-server.  This ends up blocking the process handler.
  2. If you don't have the windows authentication module installed on your web-server (it is now an optional component).
  3. If you are running on Windows Vista Home (which doesn't support the windows authentication module).
Patch Download Available

To fix the above cases which block F5 "auto-attaching" from working, we recently released a public hotfix for Visual Studio 2005.  It addresses each of the above problem causes.  You can download the hotfix patch for free here.  Once you install it, your Visual Studio F5 auto-attach behavior will work just fine.

You can read more about the patch and issues it fixes in the KB article here, and the blog posts here and here.

And if you read the comments posted to the above article, yes this QFE has been checked into the Visual Studio 2008 Beta2 source tree so will show up soon in all flavors of VS 2008! :)

For everyone building sites with VS 2005 and who want to develop and test ASP.NET/IIS websites/service more quickly, go download and install this hotfix as it'll give you first-class F5 integrated debugging and save you hours of tedious twiddling with configuration settings etc.

Enjoy! :)

* No chickens were harmed in creating the webcast!

Posted: Tuesday, July 17, 2007 11:18 AM by richardt
Anonymous comments are disabled
Page view tracker