Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The configuration section 'system.servicemodel' cannot be read because it is missing a section declaration

I have somewhat of a problem. My old webserver (windows 2003) have been replaced, with a 2008 R2. I have been given an admin account on it, and can do whatever I want, but I am no expert on this area. I configured the roles to have application developement and Web server (iis7).

BUT, my website runs .NET4, and the role only installed 3.5. So I have attempted to install .NET4 manually, on the server. My problem is, my website will not work on it, due to the System.ServiceModel section in my web.config. I have made sure it runs in .NET4 application pool.

I assume this is a WCF problem, but I can't grasp how to solve it. I have tried everything I found on google. aspnet_regis, ServiceModelReg.exe and so on. I have even tried re-installing the webserver role, but I still get this error, everytime I try to enter the sites setup.

I'm hoping there are some experts here, who know how to fix this.

like image 685
Nicolai Avatar asked Jun 16 '11 07:06

Nicolai


6 Answers

I had the same error message, and it was because I was missing the .NET 3.5.1 framework on that server. Enabling that fixed my problem: http://blogs.msdn.com/b/sqlblog/archive/2010/01/08/how-to-install-net-framework-3-5-sp1-on-windows-server-2008-r2-environments.aspx

like image 60
Mike Mooney Avatar answered Oct 22 '22 08:10

Mike Mooney


Go to the application pools in IIS and select the "Set Applicaiton Pool Default" [available in the right top corner], and check the version of .net framework.

Note: It'ld be selected as .net 4.0 version by default

like image 24
kumaresh babu Avatar answered Oct 22 '22 07:10

kumaresh babu


Apparently IIS7 needs a System.WebServer section, even if it is empty. Adding the following to my web.config file fixed my problem.

  <system.webServer>
  </system.webServer>
like image 27
Nicolai Avatar answered Oct 22 '22 08:10

Nicolai


I had a different reason for getting this error.

This happened during migration of an MVC project from .Net 4.0 to 4.5, where the Microsoft.IdentityModel library is replaced with System.identityModel. In my case I had done all the necessary Web.Config migration steps listed here, but had forgotten to change the section name in configSections section:

<configSections>
 <section name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>

As written here, the section definition should be:

<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
like image 23
Alex A. Avatar answered Oct 22 '22 07:10

Alex A.


The issue for me was that WCF Services wasn't installed. Installing that fixed the problem for me: IS7: WCF Services - .SVC do not work.

Note that changing the application pool .NET version from 2.0 to 4.0 wasn't an option for me because the site needed to run on 2.0.

like image 25
oonyalo Avatar answered Oct 22 '22 09:10

oonyalo


Because my project need run in .net 2.0 I must follow this link and it work for me with solution 3 : run file.js

http://blogs.msdn.com/b/wenlong/archive/2010/11/23/why-does-machine-config-contain-invalid-xml-content-after-installing-net-3-5-patches.aspx

like image 45
Grey Wolf Avatar answered Oct 22 '22 07:10

Grey Wolf