VJ said:
Can I add a embedded resource at run-time to assembly I trust.?. The
embedded resource that I want to add is a XML file.
No, not if it is loaded. Apart from anything else the file will be
locked by the process. In addition, Windows has a copy-on-write
mechanism so if you change the DLL you won't be changing the code that
will be accessible in memory.
As to whether you can change the DLL if it is not loaded, well, that is
more difficult to answer. If the assembly does not have a strong name
then there will not be any tamper proof checks (see my security tutorial
for details) so you could change the assembly. However, you'll have to
change the assembly's metadata tables, which involves a low level
manipulation of the bytes in the file. It's far too much effort and
prone to errors. You'll be better off using a linked resource and
changing that instead (see my Fusion tutorial for an example of how to
do this).
Richard