Unrecognized configuration section system.serviceModel

Unrecognized configuration section system.serviceModel

If you get this error when trying to use Indigo, err, I mean WCF, you need to run this command:

xws_reg /i

What happens is the ServiceModel stuff is missing out of your machine.config file.  If for some reason this doesn’t work, you can manually copy & paste the following section into your machine.config file.

    <sectionGroup name="system.serviceModel" type="System.ServiceModel.Configuration.ServiceModelSectionGroup, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <section name="behaviors" type="System.ServiceModel.Configuration.BehaviorsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <section name="client" type="System.ServiceModel.Configuration.ClientSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <section name="comContracts" type="System.ServiceModel.Configuration.ComContractsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <section name="commonBehaviors" type="System.ServiceModel.Configuration.CommonBehaviorsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowDefinition="MachineOnly" allowExeDefinition="MachineOnly" />
      <section name="diagnostics" type="System.ServiceModel.Configuration.DiagnosticSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <section name="extensions" type="System.ServiceModel.Configuration.ServiceModelExtensionsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <sectionGroup name="bindings" type="System.ServiceModel.Configuration.BindingsSectionGroup, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <section name="basicHttpBinding" type="System.ServiceModel.Configuration.BasicHttpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <section name="customBinding" type="System.ServiceModel.Configuration.CustomBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <section name="msmqIntegrationBinding" type="System.ServiceModel.Configuration.MsmqIntegrationBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <section name="netMsmqBinding" type="System.ServiceModel.Configuration.NetMsmqBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <section name="netNamedPipeBinding" type="System.ServiceModel.Configuration.NetNamedPipeBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <section name="netPeerTcpBinding" type="System.ServiceModel.Configuration.NetPeerTcpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <section name="netTcpBinding" type="System.ServiceModel.Configuration.NetTcpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <section name="wsDualHttpBinding" type="System.ServiceModel.Configuration.WSDualHttpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <section name="wsFederationBinding" type="System.ServiceModel.Configuration.WSFederationBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <section name="wsHttpBinding" type="System.ServiceModel.Configuration.WSHttpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </sectionGroup>
    </sectionGroup>

Published Thursday, November 10, 2005 9:19 PM by dotnetboy2003
Filed under:

Comments

# re: Unrecognized configuration section system.serviceModel

xws_reg.exe has been renamed to ServiceModelReg.exe.

Try looking for it in C:\WINDOWS\WinFX\v3.0\Windows Communication Foundation

Monday, August 14, 2006 12:44 PM by jmaiurano

# re: Unrecognized configuration section system.serviceModel

I've solved my problem! Thank you SO much!

Wednesday, August 29, 2007 12:58 PM by S A Brown

# re: Unrecognized configuration section system.serviceModel

re: How to make or generate publickeytoken through which algo or method and for which it is used

plz give me some sample on deepak_itprof83@yahoo.com

Wednesday, November 14, 2007 1:38 PM by deepak

# re: Unrecognized configuration section system.serviceModel

i have ServiceModelReg.exe /i

this worked. Thank you very much.

Tuesday, July 8, 2008 7:20 AM by sushil mishra

# re: Unrecognized configuration section system.serviceModel

Wow,

I search month what's going on: asp .net application with stateserver scream that can't connect do stateserver check allowremote in registry. But when SQL Managment studio don't work it say that section system.serviceModel is unknow When i fix machine.config everything works perfect asp application and SQL Managment Studio. Big thx.

Friday, November 13, 2009 4:52 AM by Radek

# re: Unrecognized configuration section system.serviceModel

This was exactly what I was looking for!!

Thanks for this good help :)

(Wondering why these lines where lost in the machine.config at default... ??)

Saturday, November 28, 2009 3:39 PM by Jakob S&#248;rensen

# re: Unrecognized configuration section system.serviceModel

This error can also be caused by using the wrong .Net Framework version setting in IIS.  So if you already have these settings in your machine.config file, go to IIS Properties for the website and change the ASP.NET setting to 2.0.

Thursday, January 7, 2010 12:27 PM by bsh69r

# re: Unrecognized configuration section system.serviceModel

Had to manually update the machine.config file.  This worked. Thanks for posting it!

Friday, February 12, 2010 4:36 AM by lifeofmle

# re: Unrecognized configuration section system.serviceModel

i have used thisserviceModelreg.exe/i. but when i restart my system again i got the same error.any body help me out

Monday, July 19, 2010 6:30 AM by Prasun

# re: Unrecognized configuration section system.serviceModel

I had to update the machine.config file. Worked immediately. Many many thanks!

Thursday, July 22, 2010 3:24 PM by Kon

# re: Unrecognized configuration section system.serviceModel

machine.config :

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG

--------------------

copy the following section :

<sectionGroup name="system.serviceModel" type="System.ServiceModel.Configuration.ServiceModelSectionGroup, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

<section name="behaviors" type="System.ServiceModel.Configuration.BehaviorsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="client" type="System.ServiceModel.Configuration.ClientSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="comContracts" type="System.ServiceModel.Configuration.ComContractsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="commonBehaviors" type="System.ServiceModel.Configuration.CommonBehaviorsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowDefinition="MachineOnly" allowExeDefinition="MachineOnly" />

<section name="diagnostics" type="System.ServiceModel.Configuration.DiagnosticSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="extensions" type="System.ServiceModel.Configuration.ServiceModelExtensionsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<sectionGroup name="bindings" type="System.ServiceModel.Configuration.BindingsSectionGroup, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

<section name="basicHttpBinding" type="System.ServiceModel.Configuration.BasicHttpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="customBinding" type="System.ServiceModel.Configuration.CustomBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="msmqIntegrationBinding" type="System.ServiceModel.Configuration.MsmqIntegrationBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="netMsmqBinding" type="System.ServiceModel.Configuration.NetMsmqBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="netNamedPipeBinding" type="System.ServiceModel.Configuration.NetNamedPipeBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="netPeerTcpBinding" type="System.ServiceModel.Configuration.NetPeerTcpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="netTcpBinding" type="System.ServiceModel.Configuration.NetTcpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="wsDualHttpBinding" type="System.ServiceModel.Configuration.WSDualHttpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="wsFederationBinding" type="System.ServiceModel.Configuration.WSFederationBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

<section name="wsHttpBinding" type="System.ServiceModel.Configuration.WSHttpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

</sectionGroup>

</sectionGroup>

-----------------------------------------------------------------------------------------

delete the section:

<system.serviceModel>

<commonBehaviors>

<endpointBehaviors>

<Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior/>

</endpointBehaviors>

<serviceBehaviors>

<Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior/>

</serviceBehaviors>

</commonBehaviors>

<extensions>

<behaviorExtensions>

<add name="Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior" type="Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior, Microsoft.VisualStudio.Diagnostics.ServiceModelSink, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

</behaviorExtensions>

</extensions>

</system.serviceModel>

it worked for me

Tuesday, August 24, 2010 6:22 AM by Sashanka

# re: Unrecognized configuration section system.serviceModel

I am using VS 2010 for creating the asp.net files and having this problem when trying to run them on the server.  All of my machine.config are version 4 and noticed the selected replacement code listed here are for version 2.0.  Does anyone have the replacement code for version 4 OR does it matter?  Thanks.

Wednesday, November 10, 2010 8:11 AM by mikec