I've been asked to do something unusual at work. We have some clients which are using applications which make calls to our DLL (let's call it Sdk.dll).
Recently, someone decided to change some namespaces in the Sdk code. If we were to provide this new DLL to our clients, their applications would break.
However, some clients will be writing applications using the new version of the DLL (let's call it Sdk.Updated.dll).
My task is to somehow support both old and new client applications, without recompiling the client apps.
I thought that I could simply replace the old Sdk.dll with a new one, which redirects all the calls to the appropriate callee in Sdk.Updated.dll. However, it seems like it will be tedious to write wrapper classes for each instance where a namespace was changed.
I'm wondering if anyone might have suggestion for a more dynamic way to accomplish this?
So, just to be clear:
Client 1:
using Sdk;
// ...
int sum = new Calc().AddTwoNumbers(3, 4);
Client 2:
using Sdk.Updated;
// ...
int sum = new Calc().AddTwoNumbers(3, 4);
Sdk.Updated.dll:
namespace Sdk.Updated {
public class Calc {
public AddTwoNumbers(int x, int y) {
return x + y;
}
}
}
What would be the best way to support both client applications, with the restriction that we can't recompile the client applications?
(As an added wrinkle, some method names may have been changed between Sdk and Sdk.Updated, but I'd rather just get an idea of how to handle the namespace thing first...)