简体   繁体   English

Visual Studio 2019 中的 nuget.exe

[英]nuget.exe in Visual Studio 2019

I have VS2017 and VS2019 on my machine.我的机器上有 VS2017 和 VS2019。 I have a lot of nuget references that are missing (yellow icon) in VS2019 Solution Explorer.我在 VS2019 解决方案资源管理器中缺少很多 nuget 引用(黄色图标)。 I've tried doing a Restore Nuget Packages and I see:我尝试执行 Restore Nuget Packages,我看到:

All packages are already installed and there is nothing to restore.
Time Elapsed: 00:00:00.0560466
========== Finished ==========

I went into the Package Manager Console and tried to do a:我进入 Package 管理器控制台并尝试执行以下操作:

nuget restore MySolution.sln

and get a并得到一个

nuget : The term 'nuget' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path 
is correct and try again.
At line:1 char:1

I looked around on my hard drive and only see nuget.exe existing in C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\SqlChangeAutomation\OctoPack\build\NuGet.exe我环顾我的硬盘,只看到 nuget.exe 存在于 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\SqlChangeAutomation\OctoPack\build\NuGet.exe

Why doesn't it also exist under 2019?为什么它在2019年不存在?

Thanks谢谢

you can download the Nuget.exe from here .您可以从此处下载 Nuget.exe。

Copy the Nuget.exe somewhere where you keep your tools.将 Nuget.exe 复制到您保存工具的位置。 Then I recommend entering the location where you saved the Nuget.exe in the PATH system variable.然后我建议在PATH系统变量中输入你保存Nuget.exe的位置。

I would try to clear the nuget cache.我会尝试清除 nuget 缓存。 You do this with the following command:您可以使用以下命令执行此操作:

nuget locals all -clear

This ensures that all packages are downloaded again.这可确保再次下载所有包。

You cannot call Nuget.exe in the Package Manager Console.您不能在 Package 管理器控制台中调用 Nuget.exe。 To do this, you have to open a console session and change to your solution directory to execute the desired command.为此,您必须打开控制台 session 并切换到您的解决方案目录以执行所需的命令。

nuget restore MySolution.sln

Above all, it is also very helpful if you browse the Nuget documentation pages a little.最重要的是,如果您稍微浏览一下 Nuget 文档页面,也会很有帮助。 You can find them here .你可以在这里找到它们。

I hope I could help you a little with it and guide you on a possible path.我希望我能为您提供一点帮助,并指导您走上一条可能的道路。

Best wishes最良好的祝愿

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何下载没有 nuget.exe 或 Visual Studio 扩展的 Nuget 包? - How to download a Nuget package without nuget.exe or Visual Studio extension? Visual Studio生成错误“此版本的NuGet.exe与您正在运行的Windows版本不兼容。” - Visual Studio build error “This version of NuGet.exe is not compatible with the version of Windows you're running.” 是否有将 nuget.exe 指向特定 NuGet.Config 文件的命令? - Is there a command to point nuget.exe to a specific NuGet.Config file? Nuget.exe和NuGet程序包管理器解决了不同的依赖性 - Nuget.exe and NuGet Package Manager resolve different dependencies 通过nuget.exe获取所有已安装的nuget依赖项 - Get all installed nuget dependencies via nuget.exe 在 Visual Studio 2019 中创建独立的 exe 文件 - Create a standalone exe file in Visual Studio 2019 如何在 Visual Studio 2019 中打开/编辑 exe - How to open / edit an exe in visual studio 2019 nuget.exe安装不更新packages.config(或.csproj)? - nuget.exe install not updating packages.config (or .csproj)? nuget.exe是否移动或无法访问(500内部服务器错误)? - Is nuget.exe moved or inaccessible (500 Internal Server Error)? 为什么 nuget dll 显示在 Visual Studio 2019 的项目根目录中? - Why the nuget dll shows in project root in Visual Studio 2019?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM