There is an article by Eric Gunnerson on AppDomains and Dynamic Loaing on the MSDN site, it should give you the idea how to do it. http://msdn.microsoft.com/library/en-us/dncscol/html/csharp05162002.asp
Regards, Hun Boon ----- Original Message ----- From: "pralay" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 28, 2002 2:25 PM Subject: [ADVANCED-DOTNET] Problem is unloading assembly > Hi, > I'm working on .NET remoting. I'm sending an object from client machine to > server by using .NET remoting. Client first gets the proxy of the server, > then calls a method of that proxy which takes the object as argument. Now > before sending the object, I'm also sending the dll containing the class > definition for the object to the server by similar mechanism. Now, after > completion of execution of the server method, which is called by client > through its proxy, on the server side, I want to delete the dll containing > the class for the object. But, before deleting the dll, I have to unload > the assembly and .NET does not allow to unload the assembly(I learnt it > from some news group). I have tried to unload the assembly by using > unmanaged code i.e. by using win32 library functions such as FreeLibrary. > That serves my purpose only for the first time, next time when I'm sending > again the object and also its dll it's giving exception. > Although I have an idea to solve this problem, but I can't apply that idea. > My idea is every time client sends the object by calling server method I > can use differnt appliaction domains to execute the server method for > different call and then unload the appliaction domain. After unloading the > application domain, we can delete the dll. But,how can I write that code? > If anybody has any idea please write. > > Regards- > Pralay > > You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced >DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. > You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.