Search code examples
.netreflection.emit

How, with reflection, can I set an assembly to be 32-bit (i.e. x86)


I know I can use CORFLAGS to force a .NET assembly to 32-bits. How can I do it when I am using reflection to create the assembly in the first place? There seems to be a function to get the value ( http://msdn.microsoft.com/en-us/library/system.reflection.module.getpekind.aspx )


Solution

  • If you're asking how to set this for a dynamic assembly generated using AssemblyBuilder, then you can use an overload of AssemblyBuilder.Save() that lets you specify this.