Click here to Skip to main content
15,887,434 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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'.
"

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
Posted

1 solution

Sorry, Use the first try option and run your vs command prompt as an admin. I have fixed it myself.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900