ServiceModelReg

WCF and ASP.NET issues on IIS

Posted on Updated on

On Windows 2008 R2 and Windows 2012 (mostly on Windows 2008) it is often noticed that although .NET framework 4.0 is installed, the WCF and IIS seems to be running on .NET 2.0

This commonly occurs due to the way the framework(s) were installed and registered on the OS.

It is especially annoying when this occurs in the production server. I recently realized this and had to work over the weekend to get it resolved. There was need to install few old services and upon activity WCF Http Activation for 3.1 using roles and features the entire v4.0 services stopped working. Sucks isn’t it!!!

After a little bit digging around and searching around, here is the best way to resolve it –

First when this occurs the errors you get are as follows (it may 1 or more of these errors)

  1. When browsing the URL for .SVC, the internal error has occurred. Unable to determine the script map
  2. In few cases, unable to determine or find System.ServiceModel v3.0 is displayed. Although the App Pool is set to v4.0
  3. Finally, when go to the Handler Mappings of the web site or Application svc mapping for 2.0 or 4.0 is not displayed.

Here is resolution steps

  • Firstly make sure if you need v2.0 and v4.0, then the WCF 3.1 Http activation is enabled. You can do this using the Windows Roles and Features MMC. If it is not installed, then install it.

12-27-2015 4-38-48 PM

  • Once this is done, confirm the registration of the Service Model under 3.0. Hence using Command Prompt in Administration Mode (or Visual Studio Command Prompt) run the following command. If it is already registered the message will confirm if it.

12-27-2015 4-42-33 PM

  • Now v2.0 version of .SVC is file is registered. Check if the .NET 4.0 of ASP.NET is registered. Hence using Command Prompt in Administration Mode (or Visual Studio Command Prompt) run the following command. If it is already registered the message will confirm if it.

12-27-2015 4-41-30 PM

  • Finally, confirm if the IIS is running on the default 4.0. This can be done by changing on the IIS.
    • Go to the IIS, click on the Machine name note. On the right side click on the Features View Tab, the Change .NET Framework version option appears. Change .NET version version to v4.0

12-27-2015 4-47-36 PM

Now go back to web site that wasn’t working and check the Handler Mapping you should see .SVC entries and confirm it by browsing the Service. Now both WCF and ASP.NET should be enabled on both .NET v2.0 and .NET v4.0

12-27-2015 4-49-26 PM