How to reference project with nuget

2019-09-11 17:20发布

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...

0条回答
登录 后发表回答