無法識別的配置節 system.serviceModel。源: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config

暖楓無敵發表於2014-11-07

今天公司網站突然無法訪問,根據提示錯誤,進行搜尋,發現伺服器的machine.config配置檔案有問題。


錯誤提示如下:

“/” 應用程式中的伺服器錯誤。


配置錯誤

說明 : 在處理向該請求提供服務所需的配置檔案時出錯。請檢查下面的特定錯誤詳細資訊並適當地修改配置檔案。 

分析器錯誤訊息 : 無法識別的配置節 system.serviceModel 。 

源錯誤 :

 

行 135:        </roleManager>

行 136: </system.web>

行 137: <system.serviceModel>

行 138:        <extensions>

行 139:                <behaviorExtensions>


原始檔 : C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Config/machine.config    行 : 137


版本資訊 :  Microsoft .NET Framework 版本 :2.0.50727.3053; ASP.NET 版本 :2.0.50727.3053

 

出現這個錯誤可能是機器重啟的時候,配置檔案中.NETFRAMEWORK3.0部分的控制執行配置並沒有加進去,所以造成配置檔案出錯,這是隻需要新增配置就可以了

   <sectionGroup name="system.serviceModel" type="System.ServiceModel.Configuration.ServiceModelSectionGroup, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
			<section name="behaviors" type="System.ServiceModel.Configuration.BehaviorsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
			<section name="bindings" type="System.ServiceModel.Configuration.BindingsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
			<section name="client" type="System.ServiceModel.Configuration.ClientSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
			<section name="comContracts" type="System.ServiceModel.Configuration.ComContractsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
			<section name="commonBehaviors" type="System.ServiceModel.Configuration.CommonBehaviorsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowDefinition="MachineOnly" allowExeDefinition="MachineOnly"/>
			<section name="diagnostics" type="System.ServiceModel.Configuration.DiagnosticSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
			<section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
			<section name="machineSettings" type="System.ServiceModel.Configuration.MachineSettingsSection, SMDiagnostics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowDefinition="MachineOnly" allowExeDefinition="MachineOnly"/>
			<section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
			<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
		</sectionGroup>
		<sectionGroup name="system.serviceModel.activation" type="System.ServiceModel.Activation.Configuration.ServiceModelActivationSectionGroup, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
			<section name="diagnostics" type="System.ServiceModel.Activation.Configuration.DiagnosticSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
			<section name="net.pipe" type="System.ServiceModel.Activation.Configuration.NetPipeSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
			<section name="net.tcp" type="System.ServiceModel.Activation.Configuration.NetTcpSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
		</sectionGroup>


把它新增到C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Config/machine.config檔案中的configSections之間就可以了。


相關文章