To make sure IIS 7 is setup to work with the latest WCF and .Net 4 framework, use these two utilities: aspnet_regiis.exe and ServiceModelReg.exe.
On an x64 machines, both of these utilities can be found in the folder: C:\Windows\Microsoft.NET\Framework64\v4.0.30319
From a command prompt launched with “Run as administrator” rights run aspnet_regiis –i –enable
Per MSDN, this
Installs the version of ASP.NET that is associated with Aspnet_regiis.exe and updates the script maps at the IIS metabase root and below.
Only the script maps for applications that use an earlier version of ASP.NET are updated. Applications that use a later version are not affected.
According to MSDN, ServiceModelReg manages the registration of a ServiceModel. Basically, as I understand it, this makes sure that .svc files use the proper .Net framework (in this case .Net 4). Run the following command: ServiceModelReg –ia
Your IIS 7 configuration should now be set to properly use WCF with the .Net 4 Framework.
To confirm, verify that the Application Pools .Net Framework Version shows v4.0 as shown below.