public SetDeclaringAssembly ( AssemblyDefinition assembly ) : void | ||
assembly | AssemblyDefinition | |
return | void |
using Mono.CSharp; var compiler = new Evaluator(new CompilerContext(new CompilerSettings(), new ConsoleReportPrinter())); var module = new ModuleContainer(compiler); module.SetDeclaringAssembly(typeof(MyClass).Assembly); //Set declaring assembly to the assembly containing MyClass
using Mono.CSharp; var compiler = new Evaluator(new CompilerContext(new CompilerSettings(), new ConsoleReportPrinter())); var module = new ModuleContainer(compiler); module.SetDeclaringAssembly(typeof(System.Console).Assembly); //Set declaring assembly to the mscorlib assemblyIn this example, we create a new ModuleContainer instance and set its declaring assembly to the assembly that contains the System.Console class, which is the mscorlib assembly. This is useful when generating code that needs to use types from the .NET framework. Package library: Mono.CSharp
public SetDeclaringAssembly ( AssemblyDefinition assembly ) : void | ||
assembly | AssemblyDefinition | |
return | void |