asp.net web api - Nuget installs old version of package Newtonsoft.Json because of WebAPI dependency -
i have website , dll project.
in dll packages.config used package:
<package id="newtonsoft.json" version="6.0.3" targetframework="net451" />
in web site packages.config use package:
<package id="microsoft.aspnet.webapi" version="5.1.2" targetframework="net451" />. package has dependency "newtonsoft.json version >= 4.5.11" added line:
<package id="newtonsoft.json" version="6.0.3" targetframework="net451" />
when launch "update-package -reinstall" nuget checks microsoft.aspnet.webapi depends on newtonsoft.json, nuget overwrites web site packages.config line
<package id="newtonsoft.json" version="4.5.11" targetframework="net451" /> , copies newtonsoft.json 4.5.11 "bin" folder of site.
also bin folder has dll depends on fresh version of newtonjson , not work..
i tried command "update-package -reinstall -ignoredependencies". helped partially: have 6.0.3 in website/bin. there 2 issues: should developers on project use "update-package -reinstall -ignoredependencies"? cannot launch update of nuget gui? project not start, dll references newtonsoft.json 4.5.0 (i have no exact error message because of using dependency injection).
does know:
* how tell nuget download newtonsoft 6.0.3 work in gui? there option in packages.config this? * if use newtonsoft json 6.0.3, should use bindingredirect fix version on assembly webapi?
thanks lot!!!
ok, found reason of issue
after editing packages.config dll project , update-package -reinstall command dll project, nuget downloaded right version of newtonsoft.json (6.0.3) dll project, did not refresh path in references of project. solution - do not edit packages.config manually. launch nuget commands package manager console or gui.
yes, bindingredirect helped second problem
Comments
Post a Comment