无法从程序集"实体框架"加载类型 'System.Data.Entity.DbSetExtensions'



从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)rn   at Microsoft.AspNet.Identity.EntityFramework.UserSecretStore`1.<Find>d__c.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)rn   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn   at Microsoft.AspNet.Identity.EntityFramework.UserSecretStore`1.<Validate>d__8.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)rn   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn   at Microsoft.AspNet.Identity.EntityFramework.IdentityStoreManager.<ValidateLocalLogin>d__20.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn   at System.Runtime.
CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)rn   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn   at Microsoft.AspNet.Identity.EntityFramework.IdentityAuthenticationManager.<CheckPasswordAndSignIn>d__22.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)rn   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()rn   at BASRaT5.Controllers.AccountController.<Login>d__2.MoveNext() in c:\dev\BASRAT\BASRaT5\BASRaT5\Controllers\AccountController.cs:line 53rn--- End of stack trace from previous location where exception was thrown ---rn   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)rn   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(
Task task)rn   at lambda_method(Closure , Task )rn   at System.Threading.Tasks.TaskHelpersExtensions.ThrowIfFaulted(Task task)rn   at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult)rn   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass34.<BeginInvokeAsynchronousActionMethod>b__33(IAsyncResult asyncResult)rn   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)rn   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()rn   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)rn   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3c()rn   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass45.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3e()rn   at System.Web.Mvc.Async.AsyncControllerAct
ionInvoker.<>c__DisplayClass30.<BeginInvokeActionMethodWithFilters>b__2f(IAsyncResult asyncResult)rn   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)rn   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()rn   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)rn   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass1e.<>c__DisplayClass28.<BeginInvokeAction>b__19()rn   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" />

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>

这以前工作过。我需要一个新版本的System.Data.Entity.Design dll吗?或者在web.config中更改程序集版本?

编辑:听起来像是Identity Framework的家伙需要发布一个更新的dll来匹配

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

更新:新版本在NuGet中可用。

名称空间和移动类型发生了一些更改。我已经更新了Beta1-RC1的样本https://github.com/rustd/AspnetIdentitySample您可以查看以下命令以获得所需更改的列表。我将很快添加一些关于该项目的文档https://github.com/rustd/AspnetIdentitySample/commit/b09479a9e5c2d4ff16c459ce0e4105c5ac5302f4

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

相关内容

  • 没有找到相关文章