加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

entity-framework – 无法从程序集’EntityFramework加载’Syste

发布时间:2020-12-16 06:32:41 所属栏目:asp.Net 来源:网络整理
导读:从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'.":
从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,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,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:devBASRATBASRaT5BASRaT5ControllersAccountController.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,PublicKeyToken=b77a5c561934e089" />
      </assemblies>
   </compilation
 </system.web>

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

编辑:
Sounds like Identity Framework guys need to release a updated dll to match?

解决方法

名称空间和移动类型有一些变化.我更新了Beta1 – RC1 https://github.com/rustd/AspnetIdentitySample的样本
您可以查看以下提交以获取所需的更改列表.我将很快在项目 https://github.com/rustd/AspnetIdentitySample/commit/b09479a9e5c2d4ff16c459ce0e4105c5ac5302f4上添加一些文档

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读