I have 20 projects in a solution file. 1 of the projects is a standard library project, in which all the links to the projects.
About a year ago, we added a new nuget package, let's call it Package A Version 5.0.0.0. He had a lot of files that he would rewrite at compile time, but in the end we got it. We added a package to our standard library project (one that contains 19 links).
I am new to Nuget (maybe I did something wrong), so I made a new package to serve as an assistant for Package A I configured everything so that the assistant depended on Package A version 3.0.0 to 5.0.0.0 (which means it works for others who have a lower version than ours). Lets call this new package Package A helper
I install Package A helper and everything works as it should. I'm going to make a stretch request, and every single app.config in our solution now has
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Package.A" publicKeyToken="8FC3CCAD86" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0"/> </dependentAssembly> </assemblyBinding> </runtime>
It will compile without it, but the visual studio complains and gives a warning. What gives? My manager will not let me merge my code now because it adds too much noise to app.config and depends too much on package A.
why should adding a package A dependent nuget then have to have this new bindRedirect when the main dependency was already done before we installed Package A helper ?
And why does it say 0.0.0.0-5.0.0.0 when I specified 3.0.0.0-5.0.0.0 in the nuget package and package.config
Update:
When I create a Package A helper with links to Package A version 5.0.0.0, then all bindRedirects will not be automatically populated in each app.config, but warnings are generated instead. I originally built it with 3.0.0.0 because I decided it was best to build it with the lowest dependency. The problem still exists, because the visual studio still warns and suggests creating a registry binding.
No way to resolve conflict between "Package A, Version=5.0.0.0, Culture=neutral, PublicKeyToken=83hfhsd33" and "Package A, Version=3.0.0.0, Culture=neutral, PublicKeyToken=83hfhsd33". Choosing "Package A, Version=5.0.0.0, Culture=neutral, PublicKeyToken=83hfhsd33" arbitrarily. Consider app.config remapping of assembly "Package A, Culture=neutral, PublicKeyToken=83hfhsd33" from Version "3.0.0.0" [] to Version "5.0.0.0" [path to Package A dll] to solve conflict and get rid of warning.
Is the solution just to change my nuget package dependency from 3.0.0.0 to 5.0.0.0 and just allow 5.0.0.0 and get rid of my allowedVersions="[3,6)" in me package.config? I do not want to reduce the usefulness and backward compatibility of my nuget package, but at the same time I do not want any warnings or bindingRedirects needed for my main solution.
Update 2: so setting Copy Local in the reference properties to False really solved my problems, but I donβt understand why.