Appdomain unloading problem
-
sexta-feira, 27 de abril de 2012 08:22The scenario goes like this. In general I am trying to develop an addin driven application. I have a core dll. This dll is hosted on the default AppDomain. My addin application also uses a copy of the core dll. Using System.AddIn(MAF) I am able to load the the addin but when I try to unload the addin, it seems that I am unable to unload the core dll because when I try to replace the dll of the entire addin, I can't replace the core dll saying that it is currently being used. Can somebody explain to me what is the idea behind? thank you.
Todas as Respostas
-
segunda-feira, 30 de abril de 2012 05:33
As long as the dll is used by another process/application/domain it cannot be unloaded.
Have you tried with AppDomain.Unload() method?
If not you can try the same. During the unload time all the resources are blocked from access and freed.
link: http://msdn.microsoft.com/en-us/library/c5b8a8f9.aspx
Resolving n Evolving in C# (http://jeanpaulva.com)
- Editado Jean Paul V.A segunda-feira, 30 de abril de 2012 05:34
- Marcado como Resposta Bob ShenMicrosoft Contingent Staff, Moderator quarta-feira, 9 de maio de 2012 03:05
-
segunda-feira, 30 de abril de 2012 05:58
Yes I already did try the AppDomain.unload() method before but same thing happened. Below is the illustration of the program.
MyProgram
- HostProgram.exe
- Core.dll
- Other dll
- AddIn Folder
- AddInProgram.dll
- Core.dll
- Other dll
Basically, Both HostProgram and AddInProgram uses the same Core.dll but with a separate copy. When AddInProgram is loaded, it will look for Core.dll as part of its dependencies. When I unload the addin while the program is still running, the only dll I couldn't replace or remove is the core.dll. I'm thinking it's because it's been loaded on the host AppDomain. Could it be possible?
-
sexta-feira, 4 de maio de 2012 03:27
Read this one http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/dc5bd181-d61d-4b69-a820-e4c2ec517e2e/
- Marcado como Resposta Bob ShenMicrosoft Contingent Staff, Moderator quarta-feira, 9 de maio de 2012 03:05

