首页 新闻 赞助 找找看

command如何添加nuget包

0
悬赏园豆:20 [已关闭问题] 关闭于 2017-12-20 00:19

按照官网我新建了一个dotnetcore项目:  

dotnet new console -o hwapp

然后我引用第三方nuget包,如Newtonsoft.Json:

dotnet add package Newtonsoft.Json
View Code

然后报找不到nuget包:

Response status code does not indicate success:404<Not Found>

info:Get http://xxx.xxx.xx.xxx/nuget/FindPackagesById()?id='Newtonsoft.Json'

info:NotFound ......

从错误信息看是在添加nuget包的时候,是默认本地网络的IP,而不是https://nuget/api/v2/

经查资料是少了一个nuget.config文件:

dotnet new nugetconfig

然后在运行一遍之前的引入包命令行,发现是另一个错:

虽然目前是用的vscode的nuget manager工具能很好的解决问题,但是我还是很想知道单纯用命令行添加包的话 怎么做

沉睡的木木夕的主页 沉睡的木木夕 | 初学一级 | 园豆:19
提问于:2017-08-15 13:32
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册