Unrecognized configuration section system.serviceModel
When I publish my website to my plesk server I g开发者_如何学Cet an error about a:
Unrecognized configuration section system.serviceModel.
What version of the .NET framework does your hoster support??
The <system.serviceModel>
is the WCF section and WCF only came about in .NET 3.0 - if this hoster is only supporting strictly .NET 2.0, then you're out of luck :-(
Solutions:
- either you can get your hosting provider to install .NET 3.0 (or preferably .NET 3.5 SP1) so you can use WCF
- you remove that
<system.serviceModel>
section from your config file if you don't even need and use WCF
The error message:
System.Configuration.ConfigurationErrorsException: Unrecognized configuration section system.serviceModel. (c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 146)
is probably caused by missing WCF section handlers. Wenlong Dong1 explains in more detail, what might be going on.
In my case I could restore the sections by running the solution steps for what he calls issue 2, that is:
%windir%\Microsoft.NET\Framework\v3.5\WFServicesReg.exe /r /b
"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" /i
%windir%\Microsoft.NET\Framework\v3.5\WFServicesReg.exe /c /b
I came across this error while trying to install one of my company's standard products, that I just couldn't get working (it's an ASP.NET 2.0 website). I found that within the C# code it references System.Configuration.ConfigurationManager.ConnectionStrings["our param name"].
I went in to IIS Admin (it's on Windows XP/SP3), the ASP.NET tab and 'Edit Configuration', and when I got to the Application tab, it just threw an unhandled exception as above, "Unexpected section system.serviceModel in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config".
I deleted the section from machine.config, and all was well, the website was able to come up as expected.
Although, to add further confusion, I have a second machine running the same web application, which also has the "system.serviceModel" section, and that works fine. Both machines have .Net 1.1, 2.0SP2, 3.0SP2 and 3.5SP1 installed. There's obviously a bit more to this, but just deleting the section appears to resolve the problem.
Symantec Backup Exec has also problems with this.
Solution: Removed all inclusive
And works fine.
Link: The Backup Exec for Windows Servers console does not open
We have two load-balanced web servers with basically identical configurations, and one of them started receiving this error after installing Windows Updates last night (1/29/2013).
I copied the machine.config file from the working machine, and it appears that everything is now working correctly.
精彩评论