Iis – Why can’t I get ASP.NET 4.0 to work on Windows Server 2003 R2

asp.netiiswindows-server-2003-r2

I've been developing an ASP.NET 4.0 application on my local machine, and today I tried to deploy it to the server. After deploying, I got the following message when trying to visit the site in my browser:

Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

Ok, no problem. That means the server's still running ASP.NET 2.0. I'll just upgrade it, right?

It hasn't been that simple.

First I installed the .NET Framework v4.0. I followed the instructions that I found at this link to enable the ASP.NET ISAPI DLLs in IIS. When I run "cscript iisext.vbs /listfile " I can see the ASP.NET 4.0 DLLs listed, and that they're enabled. However, the behavior of my application hasn't changed. I still get the same error message.

I suspect I need to change the ASP.NET version in the web site configuration in IIS. However, I can't find any way of doing so. When I right-click on either the website, the virtual directory housing my application, or the application pool in IIS, and then click "Properties" from the context menu, I expected to find an "ASP.NET" tab among the properties pages that would let me change the ASP.NET version for that site/application. However, there is no "ASP.NET" tab or properties page for some reason. Why not? How do I fix this and switch my app to .NET 4.0?

Again, this is Windows Server 2003 R2, I believe the IIS version is 6.

Best Answer

I think this will take you to the right direction:

How To Switch Website To ASP.NET4.0 in Windows Server 2003 IIS6.0

Try running aspnet_regiis.exe -i from the .Net 2.0 framework directory if ASP.NET-tab is missing.

Edit: if ASP.NET-tab still missing:

  1. Uninstall IIS (including ASP.Net)

  2. Reboot the machine.

  3. Reinstall IIS + ASP.net

  4. Run aspnet_regiis -ir

Edit2: As why the ASP.net tab is missing, this post might give some clues.

".. Apparently on Windows Server 2003 64 Bit Editions and Windows Server 2003 R2 the ASP.NET Tab in IIS doesn't appear, no fix, that's it, it's gone! .... The ASP.NET tab does not appear on x64-based editions of Windows Server 2003 and Windows Server 2003 R2. This tab also does not appear if only one version of ASP.NET is allowed in the web service extensions."