Nuget Hello World

NuGet (New-Get) is a Visual Studio extension that makes it easy to install and update third-party libraries and tools in Visual Studio.

NuGet (http://nuget.org) 类似java的maven。有兴趣的可参考如下文献:
http://www.cnblogs.com/dudu/archive/2011/07/15/nuget.html
http://www.cnblogs.com/dudu/archive/2012/06/05/nuget_server_push.html

这里主要说下如何使用。

  1. VS设置

a)   打开VS扩展管理器界面,VS – 工具 – 扩展管理器;

b)   在扩展管理器联机栏搜索“nuget”安装

c)   打开VS选项界面开启程序包还原,VS - 工具 - 选项;

  1. 项目设置

a)   开启项目Nuget还原,会生成3个文件无视它即可;

b)   添加Nuget引用

c)   搜索你需要的packages安装即可,会自动添加引用并生成1个文件无视即可;
 

  1. 在使用NuGet时,有时会出现”the remote name could not be resolved: 'nuget.org'”

原因:DNS无法解析nuget.org域名,原因你懂的。

解决:设置google DNS 解析 8.8.8.8 / 8.8.4.4

原文地址:https://www.cnblogs.com/Googler/p/2869772.html