从 entityframework 6.0.0-beta1 更新到 6.0.0-rc1 并且登录到我的 MVC5 应用程序时出现以下错误
{"Could not load type 'System.Data.Entity.DbSetExtensions' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.":"System.Data.Entity.DbSetExtensions"}
[System.TypeLoadException]: {"Could not load type 'System.Data.Entity.DbSetExtensions' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.":"System.Data.Entity.DbSetExtensions"}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
HResult: -2146233054
InnerException: null
Message: "Could not load type 'System.Data.Entity.DbSetExtensions' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'."
Source: "Microsoft.AspNet.Identity.EntityFramework"
StackTrace: " at Microsoft.AspNet.Identity.EntityFramework.Store`1.GetByID(Object id)\r\n at Microsoft.AspNet.Identity.EntityFramework.UserSecretStore`1.<Find>d__c.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.AspNet.Identity.EntityFramework.UserSecretStore`1.<Validate>d__8.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.AspNet.Identity.EntityFramework.IdentityStoreManager.<ValidateLocalLogin>d__20.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.
CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.AspNet.Identity.EntityFramework.IdentityAuthenticationManager.<CheckPasswordAndSignIn>d__22.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at BASRaT5.Controllers.AccountController.<Login>d__2.MoveNext() in c:\\dev\\BASRAT\\BASRaT5\\BASRaT5\\Controllers\\AccountController.cs:line 53\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(
Task task)\r\n at lambda_method(Closure , Task )\r\n at System.Threading.Tasks.TaskHelpersExtensions.ThrowIfFaulted(Task task)\r\n at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult)\r\n at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass34.<BeginInvokeAsynchronousActionMethod>b__33(IAsyncResult asyncResult)\r\n at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)\r\n at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()\r\n at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)\r\n at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3c()\r\n at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass45.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3e()\r\n at System.Web.Mvc.Async.AsyncControllerAct
ionInvoker.<>c__DisplayClass30.<BeginInvokeActionMethodWithFilters>b__2f(IAsyncResult asyncResult)\r\n at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)\r\n at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()\r\n at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)\r\n at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass1e.<>c__DisplayClass28.<BeginInvokeAction>b__19()\r\n at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass1e.<BeginInvokeAction>b__1b(IAsyncResult asyncResult)"
TargetSite: {System.Threading.Tasks.Task`1[TEntity] GetByID(System.Object)}
我的 csproj 有以下参考资料
<Reference Include="System.Data" />
<Reference Include="System.Data.Entity.Design" />
<Reference Include="System.Data.DataSetExtensions" />
网络配置
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation
</system.web>
这以前有效,我需要新版本的 System.Data.Entity.Design dll 吗?或更改 web.config 中的程序集版本?