'System.Data.Entity.Internal.AppConfig'的类型初始值设定项在WCF RIA Services中引发了一个异常

时间:2013-12-14 07:09:57

标签: c# wcf-ria-services entity-framework-6

我最近在我的Wcf应用程序中更新了从v5到v6的EntityFramework。发布服务后,服务可以正常工作几个小时。后来所有服务都抛出了如下的异常,我尝试了所有建议的解决方案,请任何人帮助我,

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">
a:InternalServiceFault</faultcode><faultstring xml:lang="en-US">The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.</faultstring><detail>
<ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><HelpLink i:nil="true"/><InnerException>
<HelpLink i:nil="true"/><InnerException><HelpLink i:nil="true"/><InnerException i:nil="true"/><Message>Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral,
 PublicKeyToken=b77a5d561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)</Message>
<StackTrace>   at System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host, String typeString, Boolean throwOnError)&#xD;
   at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)&#xD;
   at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.InitWithRestrictedPermissions(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)&#xD;
   at System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord)&#xD;
   at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean&amp; isRootDeclaredHere)</StackTrace><Type>System.IO.FileLoadException</Type></InnerException>
<Message>An error occurred creating the configuration section handler for entityFramework: Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5d561934e089' or one of its dependencies.
 The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (C:\inetpub\wwwroot\apps.sysinformation.net\HelpDesk\web.config line 5)</Message><StackTrace>   at System.Configuration.
BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean&amp; isRootDeclaredHere)&#xD;
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object&amp; result, Object&amp; resultRuntimeObject)&#xD;
   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)&#xD;
   at System.Data.Entity.Internal.AppConfig..ctor()&#xD;
   at System.Data.Entity.Internal.AppConfig..cctor()</StackTrace><Type>System.Configuration.ConfigurationErrorsException</Type></InnerException><Message>The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.</Message>
<StackTrace>   at System.Data.Entity.DbContext..ctor(String nameOrConnectionString)&#xD;
   at service1..ctor(Boolean proxyCreationEnabled)&#xD;
   at service1.ValidateUserIT()&#xD;
   at service1.GetTickets_ForDashBoard()&#xD;
   at SyncInvokeGetTickets_ForDashBoard(Object , Object[] , Object[] )&#xD;
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)&#xD;
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><Type>System.TypeInitializationException</Type></ExceptionDetail></detail></s:Fault></s:Body></s:Envelope>        

0 个答案:

没有答案