Visual Studio 2017 仅具有适用于 .NET Core 2.x 的脱机 Nuget 包.如何获得在线包裹? [英] Visual Studio 2017 only has offline Nuget Packages for .NET Core 2.x. How to get online packages?
问题描述
我想从 Nuget 在线获取 NuGet 包,但 Visual Studio 只给我Microsoft Visual Studio 离线包"作为一个选项.
我尝试使用以下 URL 添加另一个包源:
- 点击 Nuget 包选项卡右上角的设置齿轮.
- 在设置对话框中(如问题中的屏幕截图所示),点击
+
按钮. - 为新源指定名称和
https://api.nuget.org/v3/index.json
的源.
这似乎对我有用
I want to get NuGet Packages from Nuget online, but Visual Studio is only giving me 'Microsoft Visual Studio Offline Packages' as an option.
I have tried adding another package source using the following URLS:
and a few others, but I keep getting the following error(s):
[Package source] Unable to load the service index for source http://packagesource. An error occurred while sending the request. The remote name could not be resolved: 'packagesource' [Nuget Online] The V2 feed at 'https://www.nuget.org/Search()?$filter=IsAbsoluteLatestVersion&searchTerm=''&targetFramework=''&includePrerelease=true&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '404 Not Found'.
How can I get online packages for .NET Core?
解决方案I think the answer is:
- Right click on the project and choose
Manage NuGet packages
.
- Click on the settings cog in the top right corner of the Nuget packages tab.
- In the settings dialog (as shown in the screenshot in the question), click on the
+
button. - Give the new source a name and a source of
https://api.nuget.org/v3/index.json
.
This appears to work for me
这篇关于Visual Studio 2017 仅具有适用于 .NET Core 2.x 的脱机 Nuget 包.如何获得在线包裹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!