2

I have two versions of the same c# dll. Let's call the dll foobar.dll. I have versions 11 and 12 and I need both in the same csproj file. However, two separate classes use dependencies which require either version 11 or 12 of foobar.dll.

As an additional constraint, both versions are not backward compatible. This means primarily that version 11 use to have Object A and B in the same foobar.dll but that version 12 has Object A and B in 2 separate dlls foobar.dll and foobarPlugin.dll respectively. Hence, only using versions 12 gives runtime errors.

Is there a way to containerize dll versions to specific classes for this scenario?

Chiquelo
  • 162
  • 2
  • 13
  • 3
    Please clarify your use of the term "package". Please avoid the use of Java-specific terminology. **C# is not Java**. A `.csproj` file is not a "package" it is a "project". In the C# world a "package" is the unit of distribution in NuGet, which is something else entirely. – Dai Feb 06 '18 at 21:42
  • @Dai This is not a duplicate question as the one you referred to handles cases where the versions are backward compatible. I want to refer multiple dlls in the binding redirect – Chiquelo Feb 06 '18 at 21:49

1 Answers1

-1

Its a bit tough, but have you thought about open these dlls with reflector and recompile it the way you want?

Dorni
  • 699
  • 1
  • 5
  • 13
  • I'm trying to avoid this option. But I'm considering this brute force approach – Chiquelo Feb 06 '18 at 21:52
  • @Chiquelo Maybe you can try wrap one of the dlls with custom dll that you will create and use your own dll instead? maybe it worth trying – Dorni Feb 06 '18 at 22:14