2013-10-21 42 views
0

我正在創建一個.net 4.0應用程序,它使用AOP的PostSharp 2.1。
現在Microsoft.Bcl.Async是穩定的,我想在這個應用程序中使用asyncPostSharp + .net 4.0上的Microsoft.Bcl.Async

但是,這樣做的時候,我遇到了以下問題PostSharp

PostSharp.Sdk.CodeModel.AssemblyLoadException: Cannot find assembly 'mscorlib, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e'. [Public key mismatch] 
============ PostSharp Assembly Loading Log =================== 
LOG: Finding the assembly with binding identity 'mscorlib, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e'. 
LOG: Probing location 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll' because this file was explicitly added to the search path. 
LOG: File 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll' has identity 'mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil'. 
LOG: File 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll' does not match the reference. 

這只是發生在組件被編譯引用System.ServiceModel,包含下面的代碼:

new FaultContractAttribute(typeof(SomeType)); 

我猜測這與System.ServiceModel.FaultContractAttributector上的[__DynamicallyInvokable]屬性有關,該屬性表示:

"Performance critical to inline this type of method across NGen image boundaries". 

有沒有人遇到同樣的問題?

回答