I will try to keep this as simple as possible. I have a rather simple plugin system that has run into a problem.
I have 2 assemblies:
- Host.exe
- Plugin.dll
Plugin.dll references Host.exe (which contains interfaces and classes that Plugin.dll implement and use).
At runtime, Host.exe loads Plugin.dll through reflection and this works great. Except when Host.exe updates and gets a new version number. Then I get an error once I try to load Plugin.dll, saying that Host.exe (with the old version number) can’t be found.
This means I have to rebuild all plugins every time Host.exe changes build number.
Anyone got a solution to this?
There’s a simple solution, don’t change your [AssemblyVersion], only your [AssemblyFileVersion]. To make that meaningful, it is certainly better to move the classes that both the plug-in and the host need to a separate assembly.
Now, when you make a breaking change in one of those classes, you can change the [AssemblyVersion] to force the plug-in to be recompiled. Which is now a Good Thing instead of a problem.