Well, have you tried loading the file into a byte array (using
MemoryStream, probably) and then passing that into Assembly.Load? I
believe that in this case a temporary file will actually be written to
disk anyway, but it might help.
| Thank you.
| But I'm writing test codes for a class which uses Assembly.Load(String)
| to load a assembly, so I want to know how to solve this case.
|
You can create an additional Application domain to load/run your test
assembly. When done with this assembly you can unload the AD, this will
release the assembly and the OS will release the file handle so that you are
free to delete or replace the file.