Component based architecture: Replacing an assembly at runtime

烂漫一生 提交于 2019-12-08 04:05:23

问题


Is it a good idea to replace an assembly at runtime? What problems can I encounter?

Original question: StructureMap - Ability to replace an assembly at runtime

What is the difference in replacing an assembly at runtime within a web- and a non-web application?


回答1:


The difference is that IIS creates a new shadow copy each time you update a DLL. Hence you get a new AppDomain automatically when you add the new DLL.

WinForms etc doesn't do that magic for you and that's why it won't work.




回答2:


If the code that runs against that assembly runs in a separate AppDomain and that you shut down the appdomain before doing the operation, you should have no problem.



来源:https://stackoverflow.com/questions/7554342/component-based-architecture-replacing-an-assembly-at-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!