Component based architecture: Replacing an assembly at runtime
Is it a good idea to repla开发者_开发问答ce 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?
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.
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.
精彩评论