msbuild - 如何将环境变量EnableNuGetPackageRestore设置为true? [英] msbuild - how to set environment variable EnableNuGetPackageRestore to true?

查看:210
本文介绍了msbuild - 如何将环境变量EnableNuGetPackageRestore设置为true?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写MSbuild脚本来自动化我的构建过程,而不使用visual studio来构建我的应用程序。最近遇到这个错误



I am writing MSbuild scripts to automate my build process without using visual studio for building my application. Recently stuck up with this error

"

 $(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)尝试执行$(NugetRestore)\ NuGet.exe恢复%(Solution.Identity) - 无法正常工作 - 从nuget获取错误代码1.

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



有人可以帮忙吗?



提前致谢

"

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" 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

推荐答案

(项目路径)\。 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.


这篇关于msbuild - 如何将环境变量EnableNuGetPackageRestore设置为true?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆