Esempio n. 1
0
        public static AssemblyDefinition CreateAssembly(AssemblyNameDefinition assemblyName, string moduleName, ModuleParameters parameters)
        {
            if (assemblyName == null)
            {
                throw new ArgumentNullException("assemblyName");
            }
            if (moduleName == null)
            {
                throw new ArgumentNullException("moduleName");
            }
            Mixin.CheckParameters(parameters);
            if (parameters.Kind == ModuleKind.NetModule)
            {
                throw new ArgumentException("kind");
            }

            var assembly = ModuleDefinition.CreateModule(moduleName, parameters).Assembly;

            assembly.Name = assemblyName;

            return(assembly);
        }
Esempio n. 2
0
 public static AssemblyDefinition CreateAssembly(AssemblyNameDefinition assemblyName, string moduleName, ModuleKind kind)
 {
     return(CreateAssembly(assemblyName, moduleName, new ModuleParameters {
         Kind = kind
     }));
 }