I am trying to find a way to use multiple versions of the same library in my .NET application. My main goal with this exercise is to support new releases without having to update my application every time a new version of a library is released.
Here is a very simple use case example using a utility library:
I have created two versions of an Amazon Utility to upload documents to the AWS S3 bucket with different versions of AWSSDK.S3 nuget package with other versions very likely to follow.
Main challenge:
- Both these libraries have a dependency on different versions of AWSSDK.Core.dll and AWSSDK.S3.dll
- Both these libraries also have a dependency on the same version of some shared libraries i.e. Newtonssoft.Json and Microsoft.Extensions.Logging
- Users in my .Net application should have the option of using any version of lib. E.g. User A will use the v1 of the utility to build their process and UserB uses v2 of the utility.
I cannot drop both these libraries into the bin folder of my .Net application because you cannot have two files with the same name.
I could put them in separate folders but would that mean I also need to include all shared dlls i.e. Newtonsosft and Logging dlls.
As we can download different versions of a Nuget package, could this be used to manage these packages? I.e. I keep all shared dlls in my bin folder and use the nuget package manager to load the correct version of the nuget package.
Any other way to manage this use case?