We have a custom Code Analyzers nuget package which references specific versions of Microsoft.CodeAnalysis, Microsoft.CodeAnalysis & System.Collections.Immutable. Our nuget package is currently failing to emit build errors -> when I check the build log I can see that there is a missing binding redirect as the following is outputted:
Could not load file or assembly 'Microsoft.CodeAnalysis, Version=2.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
I can verify this by adding the following binding redirect and it works: <bindingRedirect oldVersion="0.0.0.0-2.9.0" newVersion="2.6.0.0" />.
Microsoft.CodeAnalysis is not referenced directly by any project in the solution so I am confused as to why this even works - I can't see another version in the bin, either.
I don't want to have to add a binding redirect to each project in our solution (there are over 50). Is there a way to bundle the redirect with the nuget package? Or else have it depend on a range of versions so that it is not even necessary..?