Here is the rather unpleasant pickle we got on the client site. The client has about 100 workstations on which we deployed version 1.0.0 of our MyApp product.
Now one of the things the product does is download the add-in (name it “MyPlugIn”, which it first searches on the central server to see if there is a newer version, and if it then copies this file locally, then downloads the add-in using Assembly.Load
and invokes a certain well-known interface that works well for several months.
Then the client wanted to install v1.0.1 of our product on some machines (but not all). This is due to the new and updated version of MyPlugIn.
But then a problem arose. There is a common DLL referenced by both MyApp and MyPlugIn, called MyDLL, which have a MyClass.MyMethod
method. Between v1.0.0 and v1.0.1, the signature MyClass.MyMethod has changed (parameter added). And now, the new version of MyPlugIn crashes client applications v1.0.0:
Method not found: MyClass.MyMethod (System.String)
The client clearly does not want to deploy v1.0.1 on all client stations, since the patch included in v1.0.1 was necessary only for several workstations, and there is no need to roll it back to all clients. Unfortunately, we do not use ClickOnce utilities or other utilities yet mass deployment, so deploying v1.0.1 will be a painful and otherwise unnecessary exercise.
Is there a way to write code in MyPlugin so that it works equally well, regardless of whether it deals with MyDLL v1.0.0 or v1.0.1? Perhaps there is some way of exploring the expected interface using reflection to see if it exists before calling it?
EDIT: I should also mention - we have fairly strict QA procedures. Since v1.0.1 was officially released by QA, we are not allowed to make any changes to MyApp or MyDLL. The only freedom of movement that we have is to change MyPlugin, which is special code written specifically for this client.