**********************************************************************
UPDATE - 6/20/2007
A Visual Studio patch that fixes the Visual Studio F5 debugging of IIS7 applications on Windows Vista Home Premium and above has been released! This patch solves the "An authentication error occurred while communicating with the web server. Please see Help for assistance.", and "Debugging failed because integrated Windows authentication is not enabled. Please see Help for assistance" errors, that until now had to be worked around using the instructions below.
This patch also enables customers using Windows Vista Home Premium customers to use Visual Studio F5 debugging, who were not able to use this feature at all previously because Windows Authentication was not available on Windows Vista Home Premium.
You can download the patch from connect here: Download. Also see the KB article 937523 (it is being published today, so may not be available yet).
Thank you for your patience so far, and I hope that this resolves your problems. If not, please let me know.
Thanks,
Mike
**********************************************************************
A number of people have been reporting problems when trying to debug their ASP.NET applications on Windows Vista with Visual Studio 2005 F5 debugging support. There are a handful of posts about trying to get this to work in various ways ... most of which are missing key information needed to *really* get it to work.
I am going to try and provide you with step-by-step instructions below, and explain the several tradeoffs that you may need to make along the way.
A little note about the purpose of Visual Studio's F5 debugging support:
Its designed to help you attach the debugger to the worker process running your ASP.NET application. You can always manually attach the debugger via the Menu: Tools>Attach to Process ... option, assuming you know what instance of W3WP.EXE worker process on your server the application is running in. The F5 debugging mode figures this out for you, and starts a convinient browser window for you to play around with the app. Other than that, it is the same as debugging it manually.
If you are debugging from a remote machine, you will need to run the Visual Studio Debugging Monitor on the remote machine, and open the firewall so that Visual Studio can connect to the debugger (msvsmon.exe does this for you by default). Then, you can still attach directly via the Attach to Process ... dialog, by specifying the server's machine name.
So, the bottom line is, if you know which process you need to debug, you don't need F5 debugging to debug ASP.NET apps. With that in mind, here is what it takes to get the convinient F5 Debugging working on Vista:
******************************************************************
NOTE: Be sure to get the Visual Studio 2005 SP1 update if you are running Visual Studio 2005 on Vista. This update fixes a number of incompatibilities you may otherwise hit. If you have issues installing SP1, please be sure to review Heath Stewart's blog entry at http://blogs.msdn.com/heaths/archive/2007/01/11/known-issues-with-visual-studio-2005-service-pack-1.aspx.
*******************************************************************
Unfortunately, Visual Studio 2005 SP1 still doesn't support the required elevation functionality to be able to do debugging when run by a LUA user. I hope it will very soon - in the meantime, in order to enable debugging, you need to run it as Administrator:
Install them from Control Panel > Programs > Turn Windows Features on and off:
After doing this, you may get the following error if you attempt to debug:
Always press No. This message is incorrect, and is due to a change in how versioning is done for ASP.NET applications on IIS7 that is not being properly handled by Visual Studio 2005.
Visual Studio 2005 debugging requires the ASP.NET application to have Windows Authentication enabled. This requirement also exists for Windows XP / Windows Server 2003. To enable Windows Authentication, open the IIS Manager administration tool by running Start > type inetmgr in the search box, navigate to your application, choose the Authentication tab, and Enable Windows Authentication:
Note: If you have Anonymous / Forms authentication enabled for your application, leave it on.
At this point, if you press F5 and try to attach to your application, you may either see nothing or get the following error:
This is the dreaded error that frazzles most people. The unfortunate fact is, there is a bug in ASP.NET Integrated mode (the default ASP.NET mode for IIS7) that prevents authentication from taking place correctly for the debug auto-attach feature. The bug manifests only in the following case:
The following workarounds are avaialble:
For how to move your application to Classic mode, you can consult one of the existing blog posts about this issue - for example, Rajiv's post here.
<configuration>
<system.webServer>
<modules>
<add name="debugassistant" />
</modules>
<handlers>
<add name="DebugHandler" path="DebugAttach.aspx" verb="DEBUG" type="System.Web.HttpDebugHandler" />
</handlers>
</system.webServer>
<system.web>
<compilation debug="true" />
</system.web>
</configuration>
This enables the Debug Assistant module in this application, and explicitly declares the DebugHandler handler (this is mandatory in order for debugging to work). The debug=true directive is something you need to have also but VS 2005 will warn you about it if you dont.
Well, that's it, hope it helps. Please let me know if this doesnt work for you, or you experience other issues.