I'm looking for a good implementation of hot-swapping done in .NET. The things I need are:
- Being able to deploy DLLs in a particular folder and have a running system pick them up.
- Having the running system update corresponding references in the container.
I've been looking into MEF and its directory loading mechanism, but it seems very unreliable. Maybe someone out there has an alternative implementation?
You can provide a custom event handler for
AssemblyResolve
by callingnewAppDomain()
below. Supply your directory soAppDomain
looks there. When loading a Type, use functionloadFromAppDomain()
to return it. This should allow you to copy new dlls toC:\dlls
at runtime and reload from there. (Forgive me, I translated this from my VB source to C# according to your tag.)