Ef连接Mysql ,本地正常,服务器上“未将对象引用设置到对象的实例。”我根据服务器的目录,级别,用IIS在本地建立了相对应的路径,然后在本地测试,本地可以正常运行,但是放到服务器就出错了, 这问题研究了好久了,求高手帮忙!
堆栈跟踪:
[NullReferenceException: 未将对象引用设置到对象的实例]
MySql.Data.MySqlClient.MySqlPacket.ReadString() +106
MySql.Data.MySqlClient.MySqlStream.ReadPacket() +118
MySql.Data.MySqlClient.NativeDriver.Open() +390
MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) +48
MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() +11
MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() +190
MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() +129
MySql.Data.MySqlClient.MySqlPool.GetConnection() +106
MySql.Data.MySqlClient.MySqlConnection.Open() +293
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +176
System.Data.EntityClient.EntityConnection.Open() +88
System.Data.Objects.ObjectContext.EnsureConnection() +83
System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +47
System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +45
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +203
System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__1(IEnumerable`1 sequence) +40
System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle(IEnumerable`1 query, Expression queryRoot) +60
System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +109
System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +269
InfoRelease.CourseSysCms._default.Page_Load(Object sender, EventArgs e) +488
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
|