Add module as reference in Roslyn
问题 I'm trying to implement following csc command based compilation with the Roslyn Microsoft.Codeanalysis library csc /target:library /out:UserControlBase.dll UserControlBase.cs /addmodule:"c:\artifacts\MyLib.netmodule" Following is the implementation of the same with Roslyn var compilation = await project.GetCompilationAsync(); //Add Module compilation.AddReferences(ModuleMetadata.CreateFromFile(@"c:\artifacts\MyLib.netmodule").GetReference()); compilationStatus = compilation.Emit