views:

94

answers:

3

I'm moving an ASP.NET project from .NET 3.5 to .NET 4.

Everything works beautifully if I'm debugging under web.dev (ie. in Visual Studio [2010]) but as soon as I try and run this under IIS7[.5] the debugger fails to attach. Running the project directly under IIS just causes it to throw back 403s (no subcode, so not much help there).

I setup the site by taking the current (and working!) .NET 3.5 site, and changing the AppPool to one with the .NET 4 runtime. I've confirmed that all file permissions are kosher (at least from the .NET 3.5 perspective). I feel as though I'm missing some configuration step here...

The error message when trying to attach the debugger is just "Unable to start debugging on the webserver." Not the most useful error message in the world.

Directly attaching to the associated w3wp process strongly suggests that the application is never spun up successfully.

The basic question is, how would I affect this change over from .NET 3.5 to .NET 4 for a project running under IIS?

A: 

Start a fresh project from scratch and just use the web.config there. Copy all your 3.5 pages in there and manually move over web.config elements that you need. The pages themselves don't require any converting, it's all in the web.config. The web.config for a .net 4.0 page is actually significantly smaller due to the fact that .net 4.0 is not just an extension of .net 2.0 like 3.5 is.

Carter
What's different between how web.dev and IIS treat web.config?
Kevin Montrose
+1  A: 

You cannot mix .NET frameworks in the same app pool. So ensure that only .NET 4.0 web sites are in your app pool.

Remember to set the web site/virtual directory to .NET 4 as well.

Philip Smith
+1  A: 

Figured it out.

.NET 4 had not been installed for IIS purposes. Don't ask me why that was the case.

Running asp_net_regiis -i in the .NET 4 install directory (\Windows\Frameworks\v4.0.xxxx) under the Visual Studio Command Prompt (x64 in my case) solved the problem.

Kevin Montrose