且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

msbuild - 如何将环境变量EnableNuGetPackageRestore设置为true?

更新时间:2021-10-14 22:21:14

(项目路径)\。 nuget\\\
uget.targets(93,9):错误:默认情况下禁用Packag
e restore。要同意,请打开Visual Studio Optio
ns对话框,单击Package Manager节点并选中'允许NuGet在构建期间下载mis
唱包。'您也可以通过设置environme $ b来同意$ b nt变量'EnableNuGetPackageRestore'变为'true'。
(projectpath)\.nuget\nuget.targets(93,9): error : Packag e restore is disabled by default. To give consent, open the Visual Studio Optio ns dialog, click on Package Manager node and check 'Allow NuGet to download mis sing packages during build.' You can also give consent by setting the environme nt variable 'EnableNuGetPackageRestore' to 'true'.





我试过了





1)我创建了一个自定义任务,将环境变量设置为true - 不工作。

2)尝试执行

"

I have tried


1) I have created a custom task which sets the environment variable to true - not working.
2) Tried executing "


(NugetRestore)\ NuGet.exe恢复%(Solution.Identity) - 不工作 - 从nuget得到错误代码1。

3)在Nuget.targes中将RestorePackages设置为true - 不工作。



有人可以帮忙吗?



提前致谢
(NugetRestore)\NuGet.exe" restore "%(Solution.Identity)" - not working - got error code 1 from nuget.
3) In the Nuget.targes set the RestorePackages to true - not working.

Can anybody help?

Thanks in advance


抱歉,使用第一个try选项并以管理员身份运行你的vs命令提示符。我自己修复了它。
Sorry, Use the first try option and run your vs command prompt as an admin. I have fixed it myself.