-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update package failed to update binding redirects on a web application project #3298
Comments
@jainaashish - can you please remind me which versions of NuGet have this problem? |
I got the same problem with a non-web application project when updating Moq on all my testing projects recently. This worked flawlessly in 2.0 but not 3.0 it seems. Is this a supported feature? |
@rrelyea it's reproing with 3.4.4, 3.5.0-beta2, 3.5.0-rc1, and dev branch. I didn't try it with 3.4.3 or earlier builds. |
@Mike-EEE Can you share a sample with your issue which involves non-web app projects? I looked deeper into my case and figured out for a web app project, there are multiple references for newtonsoft.json package in csproj file which causes this issue. |
Well I wouldn't say sample, but I have a solution under heavy development that you can check out here: I upgraded from NuGet 2.0 to 3.0, so I am no longer using any references under csproj's (that is, all references are in I have yet to hear from anyone whether this is expected to work in 3.0 as it did in 2.0, however. Sort of confusing and a bit frustrating at this point. 😛 FWIW, I started my inquiry on a recent NuGet blog post announcing 3.5 RC. |
As of now nuget doesn't handle binding redirects for project.json so it will need to be done manually. Work is in progress to get this feature well define and may gets into nuget 3.6 |
Great, thank you for the clarification, @jainaashish! |
Just curious (said the cat 😸)... is this being tracked with an issue(s) here on GitHub by chance? Or perhaps we should create one? |
You can create one for this! |
Great. Done: (Thanks again to those who have put in the hard work and hours into 3.0!) |
Since this is not our issue, rather template system team and they are working on a fix. So closing this issue. |
I've developed a PowerShell script that will update your config file (be it web.config or app.config) based on the packages in your packages.config and the DLL(s) in your BIN directory; so I suggest you run it on a published product.
|
BTW, the Add-BindingRedirect command of the NuGet package console does not work. It only updated 3 of the 72 referenced packages. The asterisks option did not help either (AKA "Add-BindingRedirect *") |
Repro steps:
Error:
Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Expected:
It should successfully update binding redirects in web.config file and run successfully.
The text was updated successfully, but these errors were encountered: