兄弟,解决了吗?我也碰到了类似的情况,是偶尔报这个错误,具体错误是
exMessage:The underlying provider failed on Open.
ErrorMessage>>
System.Data.Entity.Core.EntityException: The underlying provider failed on Open.
source:EntityFramework
stacktrace: at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions)
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.b__5()
at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable.GetEnumerator>b__0()
at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.b__1[TResult](IEnumerable`1 sequence)
at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
at System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](Expression expression)
at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
at Ben.Common.EFRel.RepositoryBase`2.Load(Expression`1 predicate)
at SP.Service.ServiceBase`3.Load(Expression`1 predicate, Boolean needAttach)
at _dynamic_SP.Service.ServiceBase`3[[SP.Model.Common.CrmCustomerWeixin, SP.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[SP.DAL.MasterContext, SP.DAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Load(Object , Object[] )
at Spring.Reflection.Dynamic.SafeMethod.Invoke(Object target, Object[] arguments)
at Spring.Aop.Framework.DynamicMethodInvocation.InvokeJoinpoint()
at Spring.Aop.Framework.AbstractMethodInvocation.Proceed()
at Ben.Common.Aop.ServiceAopAroundAdvice.Fk6cFLRpC(IMethodInvocation , String )
at Ben.Common.Aop.ServiceAopAroundAdvice.Invoke(IMethodInvocation invocation)
InnerException-message:拒绝访问。
InnerException-source:
InnerException-statcktrace: