Goal: control the output dll without saving or adding the artifact to the repository.
The main issue is that I have two 3rd party packages in my solution (.net framwork 4.6.1): rabbitMQClient V6.0.0 that use - system.memory (>= 4.5.4) -> System.Runtime.CompilerServices.Unsafe (>= 4.5.3)
MongoBson v2.12.1 that use System.Runtime.CompilerServices.Unsafe (>= 5.0.0) (for example)
every package provide the following System.Runtime.CompilerServices.Unsafe.dll with different version and since they are different project every one of them overrides the other in the output directory.
what I tried: If I try to downgrade the "CompilerServices.Unsafe" the mongoDb connection failed due to exception - The type initializer for 'MongoDB.Driver.Core.Misc.DnsClientWrapper..."
if I upgrade then the rabbit won't connect - inner exception: Could not load file or assembly.
I tried to use redirect but it seems that its not working (rabbitMq exception if its the new version of the dll)
The only possibility for the solution to work is if I set the copy local to false at all the projects except the project that uses the old version but since at NuGet update it will set to true I need more stable solution.