Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving an ASP.NET project to .NET 4

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?

like image 399
Kevin Montrose Avatar asked Jul 20 '10 22:07

Kevin Montrose


1 Answers

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.

like image 159
Kevin Montrose Avatar answered Nov 15 '22 00:11

Kevin Montrose