Reputation: 661
I am trying to find a solution for dynamically loading the updated dll from a folder or database in a winform (C#.NET) application.
Suppose I have an exe (say MainApplication.exe), which will act as a wrapper/container for the real business logic. The business logic will sit inside the assembly (say Business.dll). Now, how would I dynamically change the Business.dll at runtime in the event of new version of Business.dll is available.
Thanks in Advance, Rajeev Ranjan Lall
Upvotes: 1
Views: 2708
Reputation: 1214
Take a look on my question, Use AppDomain to load/unload external assemblies might help you get to the point straight away.
Upvotes: 0
Reputation: 4314
You have to load your assembly into another AppDomain, which is the only way to unload it later on.
You also need means to talk to that code and have that code talk back to you, so you'll need an API that your plugin can talk to and interfaces to implement.
Here's a nice example, I just googled. Hope it helps.
Upvotes: 3