4

은 6.0.0-RC1에 entityframework 6.0.0-β1에서 업데이트 된 내 MVC5 응용 프로그램에 로그인 할 때 나는 다음과 같은 오류를 얻을어셈블리에서 형식 'System.Data.Entity.DbSetExtensions'를로드 할 수 없습니다 'EntityFramework

{"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" /> 

의 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에서 어셈블리 버전을 변경 하시겠습니까?

편집 : Sounds like Identity Framework guys need to release a updated dll to match?

답변

2

네임 스페이스와 이동 유형이 약간 변경되었습니다. Beta1 - RC1의 샘플을 업데이트했습니다. https://github.com/rustd/AspnetIdentitySample 다음 커밋을보고 필요한 변경 사항 목록을 확인할 수 있습니다. 곧 프로젝트에 일부 문서를 추가하겠습니다. https://github.com/rustd/AspnetIdentitySample/commit/b09479a9e5c2d4ff16c459ce0e4105c5ac5302f4

+0

안녕하세요 @pranav rastogi, 업데이트 된 코드 주셔서 감사합니다. 이전 프로젝트에서 기존 구조에 문제가 발생했습니다. 일부 문서는 감사하겠습니다. 우연히 내 프로젝트에서 코드를 대체 할 때 AspNet 접두어가 붙은 테이블을 만듭니다. 샘플 프로젝트는 아니지만 – Tim

4

이 문제를 해결하고 EF6 RC는 곧 사용할 수 있습니다 지원하는 ASP.NET 정체성의 새로 고침.

업데이트 : 새 버전은 available in NuGet입니다.

+3

방금 ​​새로운 패키지를 업데이트하여 많은 오류가 발생했습니다. IdentityStoreManager를 찾을 수 없으며 IdentityStoreContext를 찾을 수 없습니다. 일부 이름 공간이 변경되었거나 이동 되었습니까? – Tim

+0

또한 많은 오류가 있지만 IdentityConfig.cs – daniel

+0

버전간에 많은 변경되었습니다 - 자세한 내용은 여기 - http://stackoverflow.com/questions/17441157/compiler-errors-after-updating-microsoft-aspnet-identity -in-mvc5 – HockeyJ

1

MVC4 프로젝트에 EntityFramework dll 버전 6을 추가 할 때이 오류가 발생합니다. EntityFramework dll을 버전 5로 다운 그레이드하면 문제가 해결되었습니다!