'Microsoft.SharePoint.dll' などを参照するアセンブリ内のメソッドを逆コンパイルしたいのですが、マシンに SharePoint がインストールされていません。次のコードを使用すると、Mono.Cecil.AssemblyResolutionException 'アセンブリ Microsoft.SharePoint の解決に失敗しました...' が発生します。
AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly("PathToMyAssembly");
ICSharpCode.Decompiler.DecompilerContext context = new ICSharpCode.Decompiler.DecompilerContext(assembly.MainModule);
AstBuilder decompiler = new AstBuilder(context);
decompiler.AddMethod(method); <!-- here it crashes -->
ILSpy GUI を使用すると、アセンブリをエラーなしで読み込むことができます (SharePoint のない同じマシンで)。
コードで何を変更する必要がありますか?