[英]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.