As @zivkan answered https://stackoverflow.com/a/77147546/6200917, default msbuild and nuget actions produces flat binary output directory preserving references original names. Renaming files there must be matched with changes in loading those renamed dll's (e.g. by directly using AssemblyLoadContext
). Making this to work seems not so obvious.
But sometimes useful solution could be obvious one, so here it is.
If those required packages are not transitive, creating trivial proxies (perhaps packing them to NuGet
format) and referring them from main project should work (and nicely integrate with default MSBuild/Nuget actions), for example:
LoadedLib.1.0.1
project heaving:
<PackageReference Include="LoadedLib" Version="1.0.1" />
LoadedLib.2.0.1
project heaving:
<PackageReference Include="LoadedLib" Version="2.0.1" />
App
project heaving
<PackageReference Include="LoadedLib" Version="3.0.1" />
<PackageReference Include="LoadedLib.1.0.1" Version="1.0.1" />
<PackageReference Include="LoadedLib.2.0.1" Version="2.0.1" />