G
Guest
I need to open an assembly, change some custom attribute's values and then re-write the assembly without re-compiling it.
I tried using Reflection.Emit, but I couldn't cast (System.Reflection.)Assembly to (System.Reflection.Emit.)AssemblyBuilder, which is the class where custom attributes are writeable (in System.Reflection.Assembly they're just readable) and has a "save" method. What's the difference between a dynamic assembly and a common one?? I guess a dynamic assembly is one changed using Reflection.Emit, not persisted, and loaded using CreateInstance
A friend recommended me to use CodeDom, but that's not what I need, I don't want to depend on the source code and re-compile the assembly, what I want is to change the assembly with no re-compiling.
I also read some info about this IMetaDataImport.IMetaDataAssemblyImport interface which is exposed via IMetaDataDispenser interface, and provides a way to change assembly's metadata and persist this changes, but I do not have enough documentation. I would appreciate some help, source code samples, whatever...
Thanks a lot!
Ricardo Carrasco
I tried using Reflection.Emit, but I couldn't cast (System.Reflection.)Assembly to (System.Reflection.Emit.)AssemblyBuilder, which is the class where custom attributes are writeable (in System.Reflection.Assembly they're just readable) and has a "save" method. What's the difference between a dynamic assembly and a common one?? I guess a dynamic assembly is one changed using Reflection.Emit, not persisted, and loaded using CreateInstance
A friend recommended me to use CodeDom, but that's not what I need, I don't want to depend on the source code and re-compile the assembly, what I want is to change the assembly with no re-compiling.
I also read some info about this IMetaDataImport.IMetaDataAssemblyImport interface which is exposed via IMetaDataDispenser interface, and provides a way to change assembly's metadata and persist this changes, but I do not have enough documentation. I would appreciate some help, source code samples, whatever...
Thanks a lot!
Ricardo Carrasco