Visual Studio 2017专业版-无法在源代码中找到包 [英] Visual Studio 2017 Professional- Unable to find package at source
问题描述
我正尝试通过nuget软件包管理器=>软件包管理器控制台以及直接从解决方案中管理Nuget软件包来添加软件包.我正在尝试从像这样的Install-Package Newtonsoft.Json
的软件包管理器安装Newtonsoft.Json
,但是无法从源文件中找到
I was trying to add package through nuget package manager=> package manager console and from Manage Nuget packages from solution directly. I am trying to install Newtonsoft.Json
from Package Manager Like this Install-Package Newtonsoft.Json
but unable to find from the source i.e
Name: nuget.org
Source: https://api.nuget.org/v3/index.json
这给了我这样的结果:
PM> Install-Package Newtonsoft.Json
Install-Package : Unable to find package 'Newtonsoft.Json' at source ''.
At line:1 char:1
+ Install-Package Newtonsoft.Json
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Time Elapsed: 00:01:30.2571879
我认为这里的source
是空白的.可能是因为它无法加载软件包.我试图管理程序包管理器设置,但无法连接.我的包管理器设置是这样的:
I think that the source
here is blank. May be because of that it is unable to load packages. I have tried to manage the package manager setting but not been able to connect. My package manager setting is like this:
尽管互联网连接良好,但我无法安装软件包.我的问题是:
Despite of having good connection of internet I am not been able to install package. My questions are:
- 我应该如何安装软件包?
- 我在安装软件包时做错了什么?
推荐答案
假定您正在使用Windows操作系统 您在安装后是否初始化了vs 2017,或者是否更新了vs 2017?
Assuming you are using Windows OS Have you initialised vs 2017 after installation or Have you updated your vs 2017?
- 如果没有,请初始化它.
- 重新启动计算机.
- 在vs 2017中打开您的项目
-
检查您的nuget软件包管理器设置.
- If not then please initialized it.
- Restart your PC.
- Open your project in vs 2017
Check your nuget package manager settings.
名称:nuget.org
Name:nuget.org
来源:api.nuget.org/v3/index.json
Source:api.nuget.org/v3/index.json
现在,从tools=>Nuget Package Manager=>Package Manager Console
运行nuget软件包管理器并编写您的install-package命令,或者从tools=>Nuget Package Manager=>
Now, run nuget package manager from tools=>Nuget Package Manager=>Package Manager Console
and write your install-package command or run Manage nuget package manager for solution from tools=>Nuget Package Manager=>
希望,对您有帮助.
这篇关于Visual Studio 2017专业版-无法在源代码中找到包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!