How to reference project with nuget

被刻印的时光 ゝ 提交于 2019-12-12 01:54:35

问题


I am trying to wrap extra functionality around json.net (Newtonsoft.Json nuget) into class library Json:

The problem: adding Json reference to Test doesn't add references to nuget auto-magically. The idea is to add reference to Json in multiple solutions afterwards. But I am only able to access Json types, Json.net namespaces aren't available.

Point is: I reference Json, reference to Json is added, json.dll and Newtonsoft.Json.dll get copied on build, but Newtonsoft.Json.dll is not referenced automatically.

I can solve the problem manually by: 1) adding references to all dlls referenced in Json into Test 2) adding nuget into Test. But I don't like either of them.

My question: what is the correct way to do what I want? Perhaps my idea of wrapping json.net is wrong? And nugets aren't designed to be used like this...

来源:https://stackoverflow.com/questions/36477275/how-to-reference-project-with-nuget

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!