Best way to add NuGet packages as project references in VS2012?

前端 未结 4 1169
夕颜
夕颜 2020-12-02 10:18

Ok. Really quick question, I\'m probably just being thick.

If you right-click on a projects \'references\' folder then \'Manage NuGet Packages\' you can then instal

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 11:21

    The other answer here didn't help me. Here's what I did, I don't know any other way to do it. I'm using VS 2013.

    • I installed the package in the Package Manager Console, e.g. PM> Install-Package Newtonsoft.Json
    • In the Solution Explorer, right click references, select Add Reference
    • Click Browse, and navigate to the dll in the packages directory under the folder of the solution.

    This adds a relative path for the reference to the project, so it should work with other people getting the code from source control into different directories.

提交回复
热议问题