Getting IIS Debugging and WCF working under Vista and Windows 7 with VS2008

After installing VS2008 on Vista and attempting to fire up a WCF application built with a .NET framework I built a couple of years ago now, I found the WCF channel was failing with no hint as to the problem. This issue also applies for running on Windows 7.

The framework architecture hosts the WCF service in IIS. When opening the solution with VS2008, I was presented with the need to run VS as an administrator. That problem is sorted easily enough, but is a bit intrusive.

Restarting VS as administrator, the next thing I tried was to step into the WEB presentation layer.

Firing up the debugger, I was presented with the error “Unable to start debugging on the web server. Strong name validation failed. Click Help for more information”.

Clicking the help did not present a solution but a quick google found a number of references to a setup a string name for iisresolver.dll, as mentioned in these links:

This did not resolved the problem, nor is it the correct way to resolve the problem.

The issue is actually with IIS7 authentication, as I found in Rick Strahl’s Web Log at http://www.west-wind.com/WebLog/posts/139869.aspx

By default, IIS7 does not install by default with Windows Authentication.

Also, IIS Metabase and IIS6 metabase configuration compatibility needs to be enabled for IIS6 based applications.

This is performed by installing the Windows Features as below:

The application also needs to be added to an application pool that uses classic managed pipeline mode, as by default IIS default application pool uses Integrated pipeline.

Setup a new application pool from IIS Manager and add the application to the new application pool.

Finally, Windows Authentication then needs  to be enabled for the IIS application:

You should now be able to debug the web application when hosted in IIS – and there is no need to attach to the wp3 worker process in the service host, which is a big improvement on XP.

At  this stage, the WCF invocation will still likely fail. This is because WCF HTTP activation is not enabled by default (nor is Non-HTTP Activation).

To enable this, go to the Control Panel -> Programs -> Turn Windows Features on or off

Find Windows .NET Framework 3.0 and enable WCF HTTP activation as show below. You can also enable non-HTTP activation while you are there.

Hopefully, everything is now working as it was before you migrated to Vista and VS2008.

Debugging

To debug the IIS process you need to start VS2008 in Administrator (Run as Administrator).

The process to attached to is called w3wp.exe on Vista.

Enjoy!

(Originally written September 2007)
Posted in Development | Tagged , , , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre user="" computer="" escaped="">