Breaking change to package restore in NuGet 1.8

Topics: Ecosystem
May 2, 2012 at 6:26 AM

There is a breaking change coming in NuGet 1.8, to package restore, that we want to let folks in the developer ecosystem know about beforehand (we'll be communicating this to general users soon). To comply with privacy requirements, starting with nuget.exe 1.8, package restore will require explicit consent from each developer using it. If you try to build using package restore (either in Visual Studio or via MSBuild), and haven't provided consent, you will see this error:

There are two ways to provide consent, as the error message indicates: either check the box in NuGet's Visual Studio settings (see below), or set an environment variable 'EnableNuGetPackageRestore' to 'true'. The latter option we expect will be used often in CI servers.

Speaking of CI servers, this might break a lot of CI builds once people update to NuGet 1.8. While the error message is helpful, there will still be confusion and frustration. We expect some of the CI servers out there might even end up setting the environment variable automatically in the process that runs the builds.

I'll let Howard (our PM) more fully describe this change and why we must make it when he writes his blog post for the general NuGet audience. But I wanted to give you folks advance notice, especially those of you that work on CI offerings. Let me know if I can answer any questions or be helpful in any other ways.

May 2, 2012 at 1:40 PM

I assume there is some kind of history to this decision. it would be nice of some of that was made clear here.

Also how does this effect people reading from the feeds using other tools for a package restore?

May 2, 2012 at 1:41 PM

and what is to stop people just setting "EnableNuGetPackageRestore" using MSBuild before the package restore

May 2, 2012 at 3:46 PM

@simoncropp I'll ask Howard to speak to why we had to make this change in his forth-coming, more general post. We don't currently attempt to thwart the various ways someone might set the environment variable in build scripts.

Coordinator
May 19, 2012 at 4:56 AM

posted some context around this decision at http://blog.nuget.org/20120518/package-restore-and-consent.html

Oct 19, 2012 at 4:04 AM
Edited Oct 19, 2012 at 8:31 AM

There are two ways to provide consent, as the error message indicates: either check the box in NuGet's Visual Studio settings (see below), or set an environment variable 'EnableNuGetPackageRestore' to 'true'. The latter option we expect will be used often in CI servers.

Thanks

social media explorer

Developer
Oct 19, 2012 at 4:20 PM

@loveneet, there's a third option, which is to pass a flag when you're building your project \ solution "/p:RequireRestoreConsent:=false".