I'm trying to upgrade a WCF web service from .NET 3.0 to 4. I've run
Aspnet_regiis.exe
and
ServiceModelReg.exe
As well as changed the Application Pool to use v4.0. I rebuilt the service dll with .NET 4.0 as the target and moved it to the /bin directory on my site.
I'm running into an error that is driving me nuts. Whenever I try to hit the site, I get the following error:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
The configuration section 'system.serviceModel' cannot be read because it is missing a section declaration
I've tried solutions I've found from googling and nothing is working. I feel like someone more experienced with IIS 7 would know exactly what's wrong. Can anyone help with this issue
I found the problem. I needed to install the hotfix described here, which is step 3 in the "One-time setup procedure for WCF samples" for these WCF code samples.
Try aspnet_regiis.exe /iru
Some things you could check:
Did you change the WCF references in your application to the Framework 4.0 versions?
Here's a Microsoft support article: Error message after you install the .NET Framework 4.0: "Could not load type 'System.ServiceModel.Activation.HttpModule'":
.svc: ensure that IIS and WCF are correctly installed and registered: http://msdn.microsoft.com/en-us/library/aa751792.aspx
Make sure WCF HTTP Activation feature is installed in Server Roles/Features (it will be the 3.5 version), then re-install .NET Framework 4.0. (You will have to install it from the download, its not part of Windows components/features)
If you're lucky, that should re-register the scriptmaps in such a way that .NET 4 will successfully receive WAS HTTP Activation requests from IIS instead of bypassign to 3.5 which doesnt understand what its being asked to do.
In theory, aspnet_regiis /i from the .NET Framework 4.0 directory should do this as well, but you said you already tried that.