Как загрузить DLL в специально созданный домен приложения
Hi Guys I am currently trying to load DLL's at runtime rather than loading all the DLL's at the same time. The issue i am having is that service that is running, has earlier or diff version of the dll i want to execute at runtime so for example the service has datatools.dll v1, but when the process runs i want it to use the datatools.dll v2, so i have some code which calculates the dll that needs to be used. So what i was thinking might work is having the service create a new app domain and load the dll's required to run load into the new app domain so that it does not conflict with the app domain the service is running from. The issue i am having is the new app domain does not want to load the dll, keep getting an error the dll does not exist, but i am reading the bytes of the file. Please could you advise.
Что я уже пробовал:
tried using the below <pre>class ProxyDomain : MarshalByRefObject {
AppDomain DLLDomain = CreateChildDomain(DLLPath);
byte[] buffer = File.ReadAllBytes(DLLPath);
Assembly assembly = DLLDomain.Load(buffer);
}