❔ How to Package Multiple Versions of a Library Targeting Different Dependency Versions into a Nuget
I am working on a C# library (
Now, the problem is, that
I need to create two different versions of
mylib) which has a dependency on another library (thatlib). Now, the problem is, that
thatlib has breaking changes between versions 1.0 and 2.0, and I need to support both versions of thatlib in my library.I need to create two different versions of
mylib, each targeting different versions of thatlib, and package them into a single NuGet package. Here are the version ranges I am targeting:mylib_v1targetingthatlibversions[1.0,2.0)mylib_v2targetingthatlibversions[2.0,5.0)
.csproj file without creating separate projects for each version. My goal is to ensure that consumers of my library get the correct version of mylib based on the version of thatlib they are using.