Question

I have a plugin structure which all is compiled using weak assemblies. I want to change this now but running into some difficulties.

interface.dll contains my interface for my plugins (IPlugin)
Load.exe will load all the plugin implementations which implements IPlugin
pluginA.dll contains a implementation of IPlugin

All assemblies is original weak assemblies.

I now want to change the assemblies to strong name assemblies.

After I have made the interface.dll and load.exe strong name assemblies I am unable to create an instance of the pluginA.dll IPlugin implementation, unless I have recompiled pluginA.dll to reference the new strong name interface.dll

Is there a way for me to set strong name on interface.dll and load.exe without being forced to recompile all plugins implementing IPlugin?

The reason I ask this, is that I have a lot of plugins and I don't have control of all of them. So I want to avoid breaking the plugin functionallity when I updated the interface.dll with a strong name.

I hope you can help me, and please do not hesitate to ask for further details if something is unclear.

Thanks

Was it helpful?

Solution

Giving an assembly a strong name is a hard breaking change. You cannot patch it up with a config file or publisher policy. So rebuilding the plug-ins is a hard requirement you cannot skip.

You didn't otherwise state the reason for deciding to do so. There is no compelling one in a plug-in scenario. A strong name provides a way to verify that an assembly is an exact match with the reference assembly that your program was built with. But, by design, you don't have a reference assembly for a plug-in. So there's nothing to verify.

OTHER TIPS

There is no way around this, unfortunately. The benefits you derive from strong-naming an assembly (most likely the reasons you are converting yours) are lost if you can reference simple named assemblies.

From Microsoft's documentation:

When you reference a strong-named assembly, you expect to get certain benefits, such as versioning and naming protection. If the strong-named assembly then references an assembly with a simple name, which does not have these benefits, you lose the benefits you would derive from using a strong-named assembly and revert to DLL conflicts. Therefore, strong-named assemblies can only reference other strong-named assemblies.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top