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>

11 Comments

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

  • 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

  • i have ServiceModelReg.exe /i

    this worked. Thank you very much.

  • 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.

  • 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... ??)

  • 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.

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

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

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

  • machine.config :

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

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

    copy the following section :

    &lt;sectionGroup name=&quot;system.serviceModel&quot; type=&quot;System.ServiceModel.Configuration.ServiceModelSectionGroup, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;&gt;

    &lt;section name=&quot;behaviors&quot; type=&quot;System.ServiceModel.Configuration.BehaviorsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;client&quot; type=&quot;System.ServiceModel.Configuration.ClientSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;comContracts&quot; type=&quot;System.ServiceModel.Configuration.ComContractsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;commonBehaviors&quot; type=&quot;System.ServiceModel.Configuration.CommonBehaviorsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; allowDefinition=&quot;MachineOnly&quot; allowExeDefinition=&quot;MachineOnly&quot; /&gt;

    &lt;section name=&quot;diagnostics&quot; type=&quot;System.ServiceModel.Configuration.DiagnosticSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;extensions&quot; type=&quot;System.ServiceModel.Configuration.ServiceModelExtensionsSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;serviceHostingEnvironment&quot; type=&quot;System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;services&quot; type=&quot;System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;sectionGroup name=&quot;bindings&quot; type=&quot;System.ServiceModel.Configuration.BindingsSectionGroup, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;&gt;

    &lt;section name=&quot;basicHttpBinding&quot; type=&quot;System.ServiceModel.Configuration.BasicHttpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;customBinding&quot; type=&quot;System.ServiceModel.Configuration.CustomBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;msmqIntegrationBinding&quot; type=&quot;System.ServiceModel.Configuration.MsmqIntegrationBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;netMsmqBinding&quot; type=&quot;System.ServiceModel.Configuration.NetMsmqBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;netNamedPipeBinding&quot; type=&quot;System.ServiceModel.Configuration.NetNamedPipeBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;netPeerTcpBinding&quot; type=&quot;System.ServiceModel.Configuration.NetPeerTcpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;netTcpBinding&quot; type=&quot;System.ServiceModel.Configuration.NetTcpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;wsDualHttpBinding&quot; type=&quot;System.ServiceModel.Configuration.WSDualHttpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;wsFederationBinding&quot; type=&quot;System.ServiceModel.Configuration.WSFederationBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;section name=&quot;wsHttpBinding&quot; type=&quot;System.ServiceModel.Configuration.WSHttpBindingSection, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;

    &lt;/sectionGroup&gt;

    &lt;/sectionGroup&gt;

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

    delete the section:

    &lt;system.serviceModel&gt;

    &lt;commonBehaviors&gt;

    &lt;endpointBehaviors&gt;

    &lt;Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior/&gt;

    &lt;/endpointBehaviors&gt;

    &lt;serviceBehaviors&gt;

    &lt;Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior/&gt;

    &lt;/serviceBehaviors&gt;

    &lt;/commonBehaviors&gt;

    &lt;extensions&gt;

    &lt;behaviorExtensions&gt;

    &lt;add name=&quot;Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior&quot; type=&quot;Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior, Microsoft.VisualStudio.Diagnostics.ServiceModelSink, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot;/&gt;

    &lt;/behaviorExtensions&gt;

    &lt;/extensions&gt;

    &lt;/system.serviceModel&gt;

    it worked for me

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

Comments have been disabled for this content.