This is a challenging problem and I don´t know if it is feasible or not, but
here you have some info:
- To create or manage Assemblies programatically you have to use
System.Reflection.Emit.DynamicAssembly.
- You can create an instance of DynamicAssembly with
AppDomain.DefineDynamicAssembly. I don´t know if you can get a
DynamicAssembly from an already existing Assembly. If the assembly is on
disk and unloaded, certainly you can disassemble it with ildasm.exe, add the
resource, and recompile it (some obfuscators use this technique to rename
symbols, etc.)
- You can add resources to a DynamicAssembly with the methods
AddResourceFile, DefineResource, DefineUnmanagegResource, etc.
- You can save the DynamicAssembly to disk with the Save method.
- You can load assemblies dynamically using Assembly.Load, Assembly.LoadFrom
or Assembly.LoadWithPartialName
- You can not unload assemblies from an AppDomain, you need to unload the
whole AddDomain, which is only possible for secondary AppDomains.
BTW, why can´t you store the license information in a separate XML file or
something like that?
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
"Nikolay Petrov" <jo******@mail.bg> escribió en el mensaje
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi Carlos,
If an assemply si not in use, can I add resources to it? If so, then
can I load assembly dynamicly?
I guess reading resources from assembly is not a problem if it is in
use. Can I unload assemlby, store the resouce and load it again?