2017-01-26 3 views
0

は、私は、次の構文を使用してロスリン経由して私のVB.NETのプロジェクトへのメタデータの参照を追加しようとしています:roslyn経由で「コピーローカル」の参照を追加するにはどうすればいいですか?

project = project.AddMetadataReference(
    MetadataReference.CreateFromFile(
     package.FullName, 
     MetadataReferenceProperties.Assembly)); 

しかし、私はそれを行う方法を、このアセンブリのためtrueに「ローカルコピー」を設定する必要がありますか?アセンブリ参照のようです私はWithEmbedInteropTypesWithAliasesしか利用できません、特定の参照の残りのプロパティを設定する方法...?

答えて

2

"copy local"は、コンパイラフィーチャーではなく、MSBuildフィーチャーであると思われます。あなたはcscコマンドラインを見れば:

     - INPUT FILES - 
/recurse:<wildcard>   Include all files in the current directory and 
           subdirectories according to the wildcard 
           specifications 
/reference:<alias>=<file>  Reference metadata from the specified assembly 
           file using the given alias (Short form: /r) 
/reference:<file list>  Reference metadata from the specified assembly 
           files (Short form: /r) 
/addmodule:<file list>  Link the specified modules into this assembly 
/link:<file list>    Embed metadata from the specified interop 
           assembly files (Short form: /l) 
/analyzer:<file list>   Run the analyzers from this assembly 
           (Short form: /a) 
/additionalfile:<file list> Additional files that don't directly affect code 
           generation but may be used by analyzers for produ 
cing 
           errors or warnings. 

エイリアスを取得するために/reference:<alias>=<file>を行うことができ、または/link:<file list>は、相互運用メタデータを埋め込むことが、ここでは何のオプション「ローカルコピー」するはありません。

あなた自身でコピーを実行する必要があります。

関連する問題