2013-01-22 3 views
0

MVC 3 프로젝트를 MVC 4로 업그레이드하려고하는데 EF5을 설치하는 동안 PostSharp은 프로젝트를 컴파일하지 못하게합니다. 아래 오류가 발생합니다. 행운을 들이지 않고 문제를 해결하기 위해 몇 시간을 소비하십시오. PostSharp는 entityframework, version=4.3.1.0을 말하지만 내 프로젝트에는 그러한 버전이 없으며, 나는 단지 5.0 version으로 남았습니다. 외부 텍스트 편집기를 사용하여 모든 프로젝트 파일을 검색하는 경우에도 "4.3.1.0"에 대한 검색 결과를 제공하지 않습니다. 그래서 나는 PostSharp가 그것을 집어 들는 지 전혀 모른다. 어떤 문제 해결 방법을 제안합니까?PostSharp 및 EntityFramework 5가 함께 작동하지 않습니다.

Error 2 Unhandled exception (2.1.7.28, 32 bit, CLR 4.0, Release): PostSharp.Sdk.CodeModel.AssemblyLoadException: Cannot find assembly 'entityframework, version=4.3.1.0, culture=neutral, publickeytoken=b77a5c561934e089'. [Version mismatch] 
============ PostSharp Assembly Loading Log =================== 
LOG: Finding the assembly with binding identity 'entityframework, version=4.3.1.0, culture=neutral, publickeytoken=b77a5c561934e089'. 
LOG: Probing location 'C:\Users\Administrator\Projects\PC\trunk\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll' because this file was explicitly added to the search path. 
LOG: File 'C:\Users\Administrator\Projects\PC\trunk\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll' has identity 'entityframework, version=5.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil'. 
LOG: File 'C:\Users\Administrator\Projects\PC\trunk\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll' does not match the reference. 
LOG: Probing location 'C:\Users\Administrator\Projects\PC\trunk\packages\PostSharp.2.1.7.28\tools\Release\EntityFramework.exe' because this directory was explicitly added to the search path. 
LOG: The file 'C:\Users\Administrator\Projects\PC\trunk\packages\PostSharp.2.1.7.28\tools\Release\EntityFramework.exe' could not be found. 
LOG: Probing location 'C:\Users\Administrator\Projects\PC\trunk\packages\PostSharp.2.1.7.28\tools\Release\EntityFramework.dll' because this directory was explicitly added to the search path. 
LOG: The file 'C:\Users\Administrator\Projects\PC\trunk\packages\PostSharp.2.1.7.28\tools\Release\EntityFramework.dll' could not be found. 
LOG: Probing location 'C:\Users\Administrator\Projects\PC\trunk\PC\EntityFramework.exe' because this directory was explicitly added to the search path. 
LOG: The file 'C:\Users\Administrator\Projects\PC\trunk\PC\EntityFramework.exe' could not be found. 
LOG: Probing location 'C:\Users\Administrator\Projects\PC\trunk\PC\EntityFramework.dll' because this directory was explicitly added to the search path. 
LOG: The file 'C:\Users\Administrator\Projects\PC\trunk\PC\EntityFramework.dll' could not be found. 
LOG: Probing location 'C:\Users\Administrator\Projects\PC\trunk\PC\bin\EntityFramework.exe' because this directory was explicitly added to the search path. 
LOG: The file 'C:\Users\Administrator\Projects\PC\trunk\PC\bin\EntityFramework.exe' could not be found. 
LOG: Probing location 'C:\Users\Administrator\Projects\PC\trunk\PC\bin\EntityFramework.dll' because this directory was explicitly added to the search path. 
LOG: File 'C:\Users\Administrator\Projects\PC\trunk\PC\bin\EntityFramework.dll' has identity 'entityframework, version=5.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil'. 
LOG: File 'C:\Users\Administrator\Projects\PC\trunk\PC\bin\EntityFramework.dll' does not match the reference. 
LOG: Probing location 'C:\Users\Administrator\Projects\PC\trunk\PC\obj\Debug\EntityFramework.exe' because this directory was explicitly added to the search path. 
LOG: The file 'C:\Users\Administrator\Projects\PC\trunk\PC\obj\Debug\EntityFramework.exe' could not be found. 
LOG: Probing location 'C:\Users\Administrator\Projects\PC\trunk\PC\obj\Debug\EntityFramework.dll' because this directory was explicitly added to the search path. 
LOG: The file 'C:\Users\Administrator\Projects\PC\trunk\PC\obj\Debug\EntityFramework.dll' could not be found. 
LOG: Probing location 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\EntityFramework.exe' because this directory was explicitly added to the search path. 
LOG: The file 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\EntityFramework.exe' could not be found. 
LOG: Probing location 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\EntityFramework.dll' because this directory was explicitly added to the search path. 
LOG: The file 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\EntityFramework.dll' could not be found. 
LOG: Probing location 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\EntityFramework.exe' because this directory was explicitly added to the search path. 
LOG: The file 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\EntityFramework.exe' could not be found. 
LOG: Probing location 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\EntityFramework.dll' because this directory was explicitly added to the search path. 
LOG: The file 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\EntityFramework.dll' could not be found. 
LOG: Looking in GAC for EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86. 
LOG: Looking in GAC for EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil. 
LOG: Looking in GAC for EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. 
LOG: The assembly 'EntityFramework_28' was not found. 
=============================================================== 
    at PostSharp.Sdk.CodeModel.Domain.GetAssembly(IAssemblyName assemblyName, BindingOptions bindingOptions) 
    at PostSharp.Sdk.CodeModel.AssemblyRefDeclaration.GetAssemblyEnvelope() 
    at PostSharp.Sdk.CodeModel.TypeRefDeclaration.GetTypeDefinition(BindingOptions bindingOptions) 
    at PostSharp.Sdk.CodeModel.TypeRefDeclaration.GetTypeDefinition() 
    at ^I3av2ouCqwmI.^4+F3cylo(INamedType _0, INamedType _1, BindingOptions _2) 
    at PostSharp.Sdk.CodeModel.TypeRefDeclaration.^A9yFoe2uB3TC(ITypeSignature _0, BindingOptions _1) 
    at ^I3av2ouCqwmI.^4+F3cylo(IMethodSignature _0, IMethodSignature _1, BindingOptions _2) 
    at PostSharp.Sdk.CodeModel.Binding.MethodSignatureComparer.Equals(IMethodSignature x, IMethodSignature y) 
    at System.Collections.Generic.Dictionary`2.FindEntry(TKey key) 
    at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) 
    at ^/vWxD3eYDOIx.^wdkNIZCy[??0](^/fRRnkiTvxqu _0, ??0 _1, ^EyL1LQX01Ck8 _2, ^0RC0kpHqS6Uy _3, Dictionary`2 _4, Int32 _5, Int32 _6) 
    at PostSharp.Sdk.Binary.ModuleWriter.SetMemberSignatureIndex(MemberRefDeclaration _0, ^EyL1LQX01Ck8 _1, ^0RC0kpHqS6Uy _2) 
    at PostSharp.Sdk.Binary.ModuleWriter.WriteMemberRef(MemberRefDeclaration _0, MetadataToken _1) 
    at PostSharp.Sdk.Binary.ModuleWriter.GetMappedDeclarationToken(MetadataDeclaration _0) 
    at PostSharp.Sdk.Binary.ModuleWriter.SetMappedMetadataToken(MetadataDeclaration _0, UInt32* _1) 
    at ^R00FfLNj7vE0.^rk33N/hO(OpCodeNumber _0, MetadataDeclaration _1) 
    at ^R00FfLNj7vE0.EmitInstructionMethod(OpCodeNumber _0, IMethod _1) 
    at PostSharp.Sdk.CodeModel.Instruction.Write(BaseInstructionWriter writer, InstructionPrefixes allowedPrefixes) 
    at ^zpGNRK5nUM9z.^x98p/iJs13L+(InstructionReader _0) 
    at PostSharp.Sdk.CodeModel.MethodBodyDeclaration.^uPrQJ6gs(InstructionBlock _0, IMethodBodyVisitor[] _1, MethodBodyVisitLevel _2, InstructionAction _3, InstructionReader _4, InstructionBlockExceptionHandlingKind _5) 
    at PostSharp.Sdk.CodeModel.MethodBodyDeclaration.^uPrQJ6gs(InstructionBlock _0, IMethodBodyVisitor[] _1, MethodBodyVisitLevel _2, InstructionAction _3, InstructionReader _4, InstructionBlockExceptionHandlingKind _5) 
    at ^zpGNRK5nUM9z.^e2BtLyuT(^Kh85h0nXrulm& _0, Int32& _1) 
    at ^zpGNRK5nUM9z.^SkiT(^ceSOybcTEumb _0) 
    at PostSharp.Sdk.Binary.ModuleWriter.WriteMethodBodies(^ceSOybcTEumb _0, UInt32 _1) 
    at ^Up6wxUIUnN6a.^VfvrABjR() 
    at ^Up6wxUIUnN6a.^SkiT() 
    at ^cyC/TYSlPGB/.^wvPm(^RtksFin57NJ8 _0, ^8gP93Xsl\+Imn _1) 
    at PostSharp.Sdk.Extensibility.Tasks.CompileTask.Execute() 
    at PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase) 
    at PostSharp.Sdk.Extensibility.Project.Execute() 
    at PostSharp.Hosting.PostSharpObject.ExecuteProjects() 
    at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation) C:\Users\Administrator\Projects\PC\trunk\PC\POSTSHARP PC 

답변

0

난 당신이 5.0 대신 v4.3.1에 대한 CLR 보이게 app.config, 일부 어셈블리 바인딩 정책을 가질 수있다 생각합니다. PostSharp는 바인딩 정책을 app.config에서 지원하지만 시스템 전반의 바인딩 정책 (예 : .NET 1.0에서 2.0으로 리디렉션하는 정책)은 지원하지 않습니다.

app.config의 바인딩 정책은 PostSharp 3에서 지원되지만 작성 시점에는이 기능에 대한 설명이없고 PostSharp 3은 여전히 ​​CTP입니다.

현재 유일한 해결책은 프로젝트의 모든 구성 요소와 참조가 v5.0에 대한 참조 (링크 됨)가 있는지 확인하여 바인딩 정책이 필요하지 않도록하는 것입니다.

관련 문제