.net - Assembly.Load(Byte[]) and Assembly.Location/Assembly.Codebase -


I am trying to load an assembly without locking the file. These assemblies can be third party assemblies, therefore, we do not necessarily have access to the code and use one or two of them assemblies. Places to read files from your directory, may depend on those files.

I know that you can do it through shadow copy but it is a real pain to work properly and on some forums several users have to load the assembly into a byte array and assembly Is recommended to use. Load (byte []) surcharge works very well as long as none of those assemblies tries to use a file in their root directory because the assembly. The location returns empty string and assembly. The codebase gives the place of applications to load the assembly.

Is there anything by any means that can set the property of the codebase or assembly I am loading? In the MSDN document for codebase and location, they are defined as overritable properties - does it mean that I can override them with the hosting application?

Can you use AppDomainSetup.ApplicationBase ? Or do you need to define that path for every assembly?

Edit : Using a filename is easy to define the codebase:

  assembly name assembly rf = new assembly name () ; AssemblyRef.CodeBase = assembly file; Assembly assembly = assembly Load (Assembly RF);  

Perhaps you can use the AppDomain.AssemblyLoad or Assembly.ModuleResolve event, but I suspect.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -