Hi All!
I am having a problem with automatic bindingRedirect overwriting, when installing nuget packages.
In most cases that behavior is expected, but in my case the problem is that the max value of the version range is decreased.
My main project has the following binding redirect:
<assemblyIdentity name="EPiServer.Framework" publicKeyToken="8fe83dea738b45b7" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-11.10.5.0" newVersion="11.10.5.0"/>
And the nuget package i am installing has the following:
<assemblyIdentity name="EPiServer.Framework" publicKeyToken="8fe83dea738b45b7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.11.0.0" newVersion="11.11.0.0" />
As you can see the problem is that the minor version in the package is higher than the version in the consuming package, therefore it is out of the version range in that particular binding. That creates an error when starting the base project, about missing assemblies.
A fix for this is to correct the range of the versions in the binding in the consuming project after the nuget package installs. But that is cumbersome and I would not want to push that responsibility on the people that would use the nuget package.
So is there any way to mitigate this problem, without manually parsing the packages.config file in the nuget a1 script file?