I am trying to load an assembly without locking the file. These assemblies can be third-party assemblies, so we do not necessarily have access to the code, and one or two of them use Assembly.Location to read files from their directory, files that they can depend on.
I know that you can do this with Shadow Copying, but it is a real pain to make it work correctly, and several users on certain forums have recommended loading the assembly into an array of bytes and using Assembly.Load (Byte []) overloads. This works fine until one of these assemblies tries to access the file in its parent directory, because Assembly.Location returns an empty string and Assembly.Codebase returns the location of the application loading the assembly.
Is there anything I can do to set the Codebase or Location properties for the assembly I am loading in any way? In the MSDN documentation for Codebase and Location, they are defined as redefinable properties - does this mean that I can redefine them from the hosting application?
source
share