2016-04-05 5 views
1

私はMEFスコープがネット4.7.1テストライブラリでの作業ゲットしようとしていますし、以下のコマンドを使用しては「System.Reflection.Assemblyから変換することはできません - MEFスコーピング

var configuration = new ContainerConfiguration() 
       .WithAssembly(typeof(MefScope).Assembly, conventions); 

3つのエラーを取得していますMefScopeは私が取得していますエラーが

Error 7 Argument 1: cannot convert from 'System.Reflection.Assembly 
[c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\mscorlib.dll]' to 
'System.Reflection.Assembly' D:\MyTest\___rc\PB\MyTest.Test\MefScope.cs 33 35 MyTest.Test 

Error 6 The best overloaded method match for 'System.Composition.Hosting.ContainerConfiguration.WithAssembly(System.Reflection.Assembly, System.Composition.Convention.AttributedModelProvider)' 
has some invalid arguments D:\MyTest\___rc\PB\MyTest.Test\MefScope.cs 33 21 MyTest.Test 

です上記の行は、(ライン32)が発生している

するクラスです

Error 5 The type 'System.Reflection.Assembly' is defined in an assembly that is not referenced. 
You must add a reference to assembly 'System.Reflection, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. D:\MyTest\___rc\PB\MyTest.Test\MefScope.cs 32 13 MyTest.Test 

これは何らかのdllの不一致であると想定していますが、System.Reflection、Version = 4.0.0.0がどこにあるのかわかりません。おそらく私はポイントをすべて一緒に欠いている。

何らかの魂が私を正しい方向に向けることができますか?私は.Net 4.5.1を使用する必要があります。

答えて

0

これは、単一のプロジェクト内で起こっているようです。新しいプロジェクトを作成して同じコード(および参照)を追加すると、問題はなくなりました。

関連する問題