Porting an ASP.NET Project to .NET 4

I am moving an ASP.NET project from .NET 3.5 to .NET 4.

Everything works beautifully if I am debugging under web.dev (ie in Visual Studio [2010]), but as soon as I try to run it under IIS7 [.5], the debugger cannot connect. Running the project directly under IIS just makes it drop 403s (without a subcode, so it doesn't help much).

I set up the site by taking the current (and working!) .NET 3.5 site and changing AppPool to one with .NET.NET 4. I have confirmed that all file permissions are kosher (at least from the point of view of .NET 3.5). It seems to me that I missed some configuration step here ...

The error message when you try to connect the debugger is simply "Unable to start debugging on the web server." Not the most useful error message in the world.

Direct attachment to the w3wp related process strongly indicates that the application is never deployed successfully.

The main question: how to influence this change from .NET 3.5 to .NET 4 for a project running under IIS?

+6
windows iis-7
source share
4 answers

Figured it out.

.NET 4 has not been installed for IIS purposes. Do not ask me why this was so.

Running asp_net_regiis -i in the .NET 4 installation directory (\ Windows \ Frameworks \ v4.0.xxxx) on the Visual Studio command prompt (x64 in my case) solved the problem.

+4
source share

You cannot mix .NET platforms in the same application pool. Therefore, make sure that your application pool has only .NET 4.0 websites.

Remember to also install the website / virtual directory on .NET 4.

+2
source share

IIS7 has two options on the "website". In IIS6, you added a sub-application as "Add a virtual directory ..." in IIS7, which forces you to support the same AppPool and, therefore, the version of the .NET framework as a website.

But IIS7 now has the "Add Application ..." option, which allows you to substantially accomplish what IIS6 allowed, so that you can explicitly tell AppPool to run and may be different from the parent site.

+1
source share

Start a new project from scratch and just use web.config. Copy all your 3.5 pages and manually move the web.config elements that you need. The pages themselves do not require conversion, all this in web.config. The web.config for the .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, such as 3.5.

0
source share

All Articles