Loading/Unloading assembly in different AppDomain?

Try this: namespace SeperateAppDomainTest { class Program { static void Main(string args) { LoadAssembly(); } public static void LoadAssembly() { string pathToDll = Assembly. GetExecutingAssembly(). CodeBase; AppDomainSetup domainSetup = new AppDomainSetup { PrivateBinPath = pathToDll }; var newDomain = AppDomain.

CreateDomain("FooBar", null, domainSetup); ProxyClass c = (ProxyClass)(newDomain. CreateInstanceFromAndUnwrap(pathToDll, typeof(ProxyClass). FullName)); Console.

WriteLine(c == null); Console. ReadKey(true); } } public class ProxyClass : MarshalByRefObject { }.

Thanks for the hint with the AppDomainSetup, but it does not solve the issue. See my updated question – Scoregraphic Jan 25 '10 at 14:46.

Take a look into this previous answer: How to load an assembly into different AppDomain on Windows Mobile (.NET CF)?. That answer creates a proxy class which runs into new AppDomain context so, there, you can have full control of your initialization. You could to create a Start() method into ServiceApplicationProxy class and just call it normally from your hoster with a proxy.Start().

Thanks for your answer. I've tried this, but I'm still getting errors. See my update in the original question.

– Scoregraphic Jan 25 '10 at 14:32.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions