C++ 在 Visual Studio 2017 中找不到 nuget 包管理器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42875451/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 15:31:56  来源:igfitidea点击:

Can't find the nuget package manager in visual studio 2017?

c++visual-studionugetvisual-studio-2017

提问by sam

I installed package installer from Tools->Extensions and Updates. I tried searching in the tools menu, couldn't find install nuget packageoption. Also if I right click on the project, there is an option Quick Install Package, In the box there I fill in the nuget package I want to add in my project (openBLAS in my case) and it says, Visual studio needs to restart.

我从Tools-> Extensions and Updates安装了包安装程序。我尝试在工具菜单中搜索,找不到安装 nuget 包选项。此外,如果我右键单击该项目,则会有一个选项Quick Install Package,在那里的框中填写我想添加到我的项目中的 nuget 包(在我的情况下为 openBLAS),并显示Visual Studio 需要重新启动

Iam working in Visual C++ win32 console application and tried finding the nuget package manager for other projects as well.

我在 Visual C++ win32 控制台应用程序中工作,并尝试为其他项目找到 nuget 包管理器。

I restarted my visual studio and even my PC too, but still couldn't find it. Please help!

我重新启动了我的视觉工作室,甚至我的电脑,但仍然找不到它。请帮忙!

回答by Nandee

It's not installed by default(as far as I know) you have to select It in the Visual Studio Installer manually.

它不是默认安装的(据我所知),您必须在 Visual Studio 安装程序中手动选择它。

First open up your Visual Studio installer (e.g., via Tools->Get Tools and Features...). Modify your currently installed product. You can find the NuGet package managerunder the Individual componentstab.

首先打开您的 Visual Studio 安装程序(例如,通过Tools->Get Tools and Features...)。修改您当前安装的产品。您可以在单个组件选项卡下找到NuGet 包管理器

回答by Leo Liu-MSFT

Can't find the nuget package manager in visual studio 2017?

在 Visual Studio 2017 中找不到 nuget 包管理器?

As per nuget blog:

根据nuget 博客

Starting with NuGet 4.0 in Visual Studio 2017, the NuGet Package Manager will be shipped as a part of Visual Studio, and newer versions will not be available for download from the VS extensions gallery. NuGet updates will be pulled in automatically along with other Visual Studio updates.

从 Visual Studio 2017 中的 NuGet 4.0 开始,NuGet 包管理器将作为 Visual Studio 的一部分提供,更新版本将无法从 VS 扩展库下载。NuGet 更新将与其他 Visual Studio 更新一起自动拉入。

So the NuGet Package Manager extension is already built-in Visual Studio 2017, do not have to install or update it.

所以NuGet 包管理器扩展已经内置在 Visual Studio 2017 中,不必安装或更新它。

After install the Visual Studio 2017, you can use nuget package manager directly. Right click on the project, there is an option Manager NuGet packages..., In the Browsethere filled in the openBLAS nuget package, then select the package version and install it:

安装 Visual Studio 2017 后,可以直接使用 nuget 包管理器。右键项目,有一个选项Manager NuGet packages...,在Browse里面填上openBLAS nuget包,然后选择包版本并安装:

enter image description here

在此处输入图片说明

Besides, you can also install the nuget package by NuGet commands directly within Visual Studio, for more detail information you can refer to the NuGet Documentation.

此外,您还可以直接在 Visual Studio 中通过 NuGet 命令安装 nuget 包,有关更多详细信息,您可以参考NuGet 文档

回答by ndreisg

This worked for me:

这对我有用:

Delete %AppData%\NuGet\Nuget.configthen Restart Visual Studio

删除%AppData%\NuGet\Nuget.config然后重新启动 Visual Studio

(Deleting the Nuget.config forces VS to create a new config file, this can solve many different problems depending on what was broken in your config file)

(删除 Nuget.config 会强制 VS 创建一个新的配置文件,这可以解决许多不同的问题,具体取决于配置文件中的损坏内容)

回答by Mark Uebel

My experience with VS2017 is that NuGet Package Manager was not automatically installed. It had to be selected via the VS Installer:

我对 VS2017 的经验是 NuGet 包管理器没有自动安装。必须通过 VS 安装程序选择它:

enter image description here

在此处输入图片说明

Failing to select/install these on the initial install, I had to go back and add/install them later. However, after installing, the Package Sources in the NuGet Package Manager were limited to "Microsoft Visual Studio Offline Packages" and package restore would not function correctly. Following the suggestion of @ndreisg, I deleted the Nuget.config file. Then upon restart of VS2017, everything worked, and I was able to restore packages to an existing solution.

未能在初始安装时选择/安装这些,我不得不稍后返回并添加/安装它们。但是,安装后,NuGet 包管理器中的包源仅限于“Microsoft Visual Studio 脱机包”,并且包还原无法正常运行。按照@ndreisg 的建议,我删除了 Nuget.config 文件。然后在重新启动 VS2017 后,一切正常,我能够将包恢复到现有解决方案。

回答by Enrique Ruiz-Velasco

I was using Visual Studio 2017 Community and couldn't find the NuGet Pkg Manager in the Tool menu. I went to Tools->Extensions & Updates... Selected Visual Studio Update and that launched the Visual Studio Installer. After it run the update the NuGet Package Manager menu was added..

我使用的是 Visual Studio 2017 社区,但在“工具”菜单中找不到 NuGet Pkg 管理器。我去了工具->扩展和更新...选择了 Visual Studio 更新并启动了 Visual Studio 安装程序。运行更新后,添加了 NuGet 包管理器菜单。