views:

67

answers:

2

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

+3  A: 

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.

Robert Giesecke
A: 

Take a look on my question, http://stackoverflow.com/questions/1687245/use-appdomain-to-load-unload-external-assemblies might help you get to the point straight away.

Bolek Tekielski