VS2017 Build error - The command nuget restore exited with code 9009(VS2017 构建错误 - 命令 nuget restore 退出,代码为 9009)
问题描述
当我构建我的项目时,我看到以下错误.
<块引用>命令nuget restore ProjectName.csproj - PackagesDirectory"....包"以 9009 退出.
当我点击我的 .csproj 上的编辑时,我看到下面的代码行
<目标名称=BeforeBuild"><执行工作目录=$(ProjDir)";command = "nuget restore $(ProjectName) -PackagesDirectory....包></执行></目标>首先,你应该确保你已经下载了
2)然后打开系统环境变量PATH,配置本地nuget.exe的路径.
然后,点击全部确定选项保存.
之后,可以打开CMD,输入nuget查看是否可以调用nuget.exe.
第二,关闭所有vs实例或msbuild窗口,打开你项目的xxx.csproj文件,
改为,使用这个:
<目标名称=BeforeBuild"><执行工作目录=$(ProjectDir)";command = "nuget restore $(MSBuildProjectFile) -PackagesDirectory ..packages "></执行></目标>重新启动您的项目,或接近重新唤醒 MSBuild 以构建您的项目.
它在我这边效果很好.
When i am bulding my project i see the below error.
The command "nuget restore ProjectName.csproj - PackagesDirectory ....packages" exited with 9009.
When i clicked edit on my .csproj i see below lines of code
<Target Name="BeforeBuild">
<Exec WorkingDirectory ="$(ProjDir)" command = "nuget restore $(ProjectName) -PackagesDirectory
....packages>
</Exec>
</Target>
First, you should make sure that you have downloaded the latest nuget.exe v5.7.0 and config it full path into System Environment PATH.
1) download it and copy it into a folder
2) then open System Environment Variable PATH and config the path of local nuget.exe into it.
Then, click all Ok option to save it.
After that, you can open CMD and type nuget to check whether it can call nuget.exe.
Second, close all vs instance or msbuild window, open your xxx.csproj file of your project,
Instead, use this:
<Target Name="BeforeBuild">
<Exec WorkingDirectory="$(ProjectDir)" command = "nuget restore $(MSBuildProjectFile) -PackagesDirectory ..packages ">
</Exec>
</Target>
Restart your project, or close to reawaken MSBuild to build your project.
It works well in my side.
这篇关于VS2017 构建错误 - 命令 nuget restore 退出,代码为 9009的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:VS2017 构建错误 - 命令 nuget restore 退出,代码为 9009
基础教程推荐
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- WPF 模态进度窗口 2022-01-01
