基础提供程序在带有实体框架的Open WCF服务上失败

时间:2019-05-10 10:15:38

标签: c# entity-framework wcf

我们的应用程序具有三组服务器(Web,App,DB)。 Web层由UI组成,而app层由服务组成。每个都有自己的专用服务器。最近,我们的客户要求将数据库服务器迁移到2016年(现在是2008年)。因此,我从2008年开始进行数据库备份,并在2016年数据库服务器中进行了还原。然后,我配置了应用程序层服务(WCF和WebServices)以指向2016年数据库。现在我无法登录。并且我使用WCF测试客户端检查了服务,但出现以下错误

  

基础提供程序在打开时失败。完全例外:System.ServiceModel.FaultException`1 [System.ServiceModel.ExceptionDetail]:基础提供程序在打开时失败。 (故障详细信息等于ExceptionDetail,可能是由IncludeExceptionDetailInFaults = true

创建的

详细的内部异常消息:

超时已过期。在操作完成之前超时或服务器没有响应。在System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj,在System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)在System.Data.SqlClient.SqlInternalConnection.OnError(SqlException异常,布尔BreakConnection) .Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,SqlInterna ...)。 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage消息)在[0]处引发异常: System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&msgData,Int32类型)位于client.services.SSO.validatesptoken()上的System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)。 / p>

有时我也会收到此内部异常错误消息

测试错误消息:执行命令需要打开并可用的连接。连接的当前状态已断开。完全例外:

处的System.ServiceModel.FaultException 1[System.ServiceModel.ExceptionDetail]: Execution of the command requires an open and available connection. The connection's current state is broken. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.InvalidOperationException: Execution of the command requires an open and available connection. The connection's current state is broken. at System.Data.Objects.ObjectContext.EnsureConnection() at System.Data.Objects.ObjectQuery 1.GetResults(Nullable`1 forMergeOption)

但是此错误仅出现在使用实体框架的服务上,其他Web服务运行正常。 我也将发布EF连接字符串

<add
      name="SSOObjectContext" connectionString="metadata=res://*/SSOModel.csdl|res://*/SSOModel.ssdl|res://*/SSOModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=myDBServer;initial catalog=***;Persist Security Info=True;User ID=***;Password=***;MultipleActiveResultSets=True&quot;"
      providerName="System.Data.EntityClient" />

这与用户权限或连接字符串无关,因为我尝试并使用答案进行了修改,但找不到任何运气。事实证明这很棘手,对您的帮助将不胜感激。

0 个答案:

没有答案