visual studio - Trouble Automatically Restoring Nuget Packages Xunit and Newtonsoft.Json -


i'm working on performing nuget migration create common package directory across solutions. wrote script rid of nuget config files, target files, hint paths (this should not needed nuget automatic package restore), , couple of other things in project , solution files. have 1 nuget config file.

the migration worked expected part. ran issues xunit , newtonsoft.json packages. example, projects not find xunit package , visual studio showed following error: "the type or namespace 'xunit' not found (are missing assembly reference?" way able fix reinstall xunit package running following command:

update-package –reinstall xunit 

when reinstalled xunit hint paths added in project files , following code added app.config file:

 <dependentassembly>       <assemblyidentity name="newtonsoft.json" publickeytoken="30ad4fe6b2a6aeed"   culture="neutral" />       <bindingredirect oldversion="0.0.0.0-6.0.0.0" newversion="6.0.0.0" /> </dependentassembly> 

my question why seem need hint paths , of other stuff xunit , newtonsoft.json packages? there way fix without them? exact sort of thing i'm trying avoid performing migration.

if using packages.config file need hint paths msbuild can resolve assemblies. xunit , json.net not installed gac without hint paths, or other mechanism such reference path configured project, build cannot find assemblies. time update nuget packages hint paths added project file.

a similar problem occur custom msbuild .targets files used. if remove them project msbuild cannot find them.

nuget restore download packages , extract them packages directory. not modify project files.

if want avoid using hint paths should @ using project.json file instead of packages.config file. if use project.json file assemblies resolved @ build time using nuget targets file without having have references or hint paths in project file (.csproj).


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -