Entity framework 无法加载类型';System.Data.Entity.DbSetExtensions';来自组件';实体框架

Entity framework 无法加载类型';System.Data.Entity.DbSetExtensions';来自组件';实体框架,entity-framework,entity-framework-6,asp.net-mvc-5,asp.net-identity,Entity Framework,Entity Framework 6,Asp.net Mvc 5,Asp.net Identity,从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.DbSetExt

从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)}
{“无法从程序集'EntityFramework,版本=6.0.0.0,区域性=neutral,PublicKeyToken=b77a5c561934e089'加载类型'System.Data.Entity.DbSetExtensions'”:“System.Data.Entity.DbSetExtensions”}
[System.TypeLoadException]:{“无法从程序集'EntityFramework,版本=6.0.0.0,区域性=neutral,PublicKeyToken=b77a5c561934e089'加载类型'System.Data.Entity.DbSetExtensions'。“:“System.Data.Entity.DbSetExtensions”}
数据:{System.Collections.ListDictionaryInternal}
帮助链接:空
HResult:-2146233054
InnerException:null
消息:“无法从程序集“EntityFramework,版本=6.0.0.0,区域性=中性,PublicKeyToken=b77a5c561934e089”加载类型“System.Data.Entity.DbSetExtensions”。”
来源:“Microsoft.AspNet.Identity.EntityFramework”
StackTrace:“在Microsoft.AspNet.Identity.EntityFramework.Store`1.GetByID(对象id)\r\n在Microsoft.AspNet.Identity.EntityFramework.UserSecretStore`1.d\u c.MoveNext()\r\n---从引发异常的上一个位置开始的堆栈结束跟踪----\r\n在System.Runtime.CompilerServices.TaskWaiter.ThrowForOnSuccess(任务任务)\r\n位于Microsoft.AspNet.Identity.EntityFramework.UserSecretStore`1.d\u 8.MoveNext()\r\n---从引发异常的上一个位置开始的堆栈结束跟踪----\r\n位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForOnSuccess(任务任务)\r\n位于Microsoft.AspNet.Identity.EntityFramework.IdentityStoreManager.d\u 20.MoveNext()\r\n---来自在System.Runtime引发异常的上一个位置的堆栈结束跟踪----\r\n。
CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)\r\n位于Microsoft.AspNet.Identity.EntityFramework.IdentityAuthenticationManager.d_22.MoveNext()的System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务任务任务)\r\n\r\n----从引发异常的上一个位置开始的堆栈结束跟踪----\r\n在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务任务)\r\n在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务任务任务)\r\n在System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n在c:\\dev\\BASRAT\\BASRaT5\\BASRaT5\\Controllers\\AccountController.cs中的BASRaT5.Controllers.AccountController.d\u 2.MoveNext()处:第53行\r\n--从引发异常的上一个位置开始的堆栈结束跟踪----\r\n在System.Runtime.CompilerServices.TaskWaiter.ThrowForOnSuccess(任务任务)\r\n位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(
任务任务\r\n在lambda\u方法(闭包,任务)\r\n在System.Threading.Tasks.TaskHelperExtensions.ThrowIfFaulted(任务任务)\r\n在System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult)\r\n在System.Web.Mvc.Async.AsyncControllerActionInvoker.c\uu DisplayClass34.b\u33(IAsyncResult asyncResult asyncResult)\r\n位于System.Web.Mvc.Async.AsyncResultRapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)\r\n位于System.Web.Mvc.Async.AsyncResultRapper.WrappedAsyncResultBase`1.End()\r\n位于System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)\r\n在System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvokwithFilters.b_uu3C()\r\n在System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvokwithFilters.c_u显示类45.b_u3e()\r\n在System.Web.Mvc.Async.AsyncControllerAction
在System.Web.Mvc.asyncResult.Async.AsyncResultRapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)\r\n在System.Web.Mvc.Async.AsyncResultAsyncResult.WrappedAsyncResultBase`1.End()\r\n在System.Web.Mvc.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)\r\n在System.Web.Mvc.Async.AsyncControllerActionInvoker.c_uDisplayClass1E.c_uDisplayClass28.b_u19()\r\n在System.Web.Mvc.Async.AsyncControllerActionInvoker.c_uDisplayClass1E.b_u1B(IAsyncResult asyncResult asyncResult)
TargetSite:{System.Threading.Tasks.Task`1[tenty]GetByID(System.Object)}
我的csproj有以下参考资料

<Reference Include="System.Data" />
<Reference Include="System.Data.Entity.Design" />
<Reference Include="System.Data.DataSetExtensions" />

web.config

 <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>


修复此问题并支持EF6 RC的ASP.NET标识刷新将很快提供


更新:新版本是。

名称空间和移动类型有一些变化。我更新了Beta1-RC1中的示例
您可以查看以下命令以获得所需更改的列表。我将很快在项目上添加一些文档

我在将EntityFramework dll版本6添加到MVC4项目时遇到此错误。将EntityFramework dll降级到版本5解决了我的问题!

刚刚更新了新包,现在发现了许多错误。IdentityStoreManager cou找不到ld,找不到IdentityStoreContext等。是否重命名或移动了某些名称空间?版本之间发生了很大变化-此处有更多信息-hi@pranav rastogi,感谢更新的代码。我在上一个项目中遇到了问题,试图使其与我现有的结构一起工作。希望提供一些文档d、 顺便说一句,当我替换项目中的代码时,它会创建以AspNet为前缀的表,而示例项目中没有