Eri*_*ric 5 c# nuget visual-studio-2017 visual-studio-2019
我的机器上有 VS2017 和 VS2019。我在 VS2019 解决方案资源管理器中缺少很多 nuget 引用(黄色图标)。我试过做一个恢复 Nuget 包,我看到:
All packages are already installed and there is nothing to restore.
Time Elapsed: 00:00:00.0560466
========== Finished ==========
Run Code Online (Sandbox Code Playgroud)
我进入包管理器控制台并尝试执行以下操作:
nuget restore MySolution.sln
Run Code Online (Sandbox Code Playgroud)
并得到一个
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
Run Code Online (Sandbox Code Playgroud)
我环顾我的硬盘,只看到 nuget.exe 存在于 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\SqlChangeAutomation\OctoPack\build\NuGet.exe
为什么它在 2019 下也不存在?
谢谢
你可以从这里下载 Nuget.exe 。
将 Nuget.exe 复制到您保存工具的位置。然后我建议在 PATH 系统变量中输入保存 Nuget.exe 的位置。
我会尝试清除 nuget 缓存。您可以使用以下命令执行此操作:
nuget locals all -clear
Run Code Online (Sandbox Code Playgroud)
这可确保再次下载所有包。
您不能在包管理器控制台中调用 Nuget.exe。为此,您必须打开一个控制台会话并切换到您的解决方案目录以执行所需的命令。
nuget restore MySolution.sln
Run Code Online (Sandbox Code Playgroud)
最重要的是,如果您稍微浏览一下 Nuget 文档页面,这也非常有帮助。您可以在此处找到它们。
我希望我能对你有所帮助,并指导你走上可能的道路。
最好的祝愿
| 归档时间: |
|
| 查看次数: |
12648 次 |
| 最近记录: |