NuGet Update broken in v2.1?

Topics: General
Oct 8, 2012 at 10:24 PM

We don't check in packages.config and don't use the NuGet restore feature. It seems that nuget update is broken. Here is my example workflow:

Basic Solution Structure:

c:\MyLibrary\MyLibrary.sln

c:\MyLibrary\MyLibrary\MyLibrary.csproj

c:\MyLibrary\MyLibrary\packages.config

c:\MyLibrary\packages\repositories.config

 

packages.config has two package dependencies, x and y, and the version of both is version 1.0.0. Package y has an update available for v1.0.1.

I execute the following command:

nuget install -source http://myfeed/api/v2 -solutiondir c:\MyLibrary c:\MyLibrary\MyLibrary\packages.config

The c:\MyLibrary\packages\ has two directories for package x and y:

x.1.0.0

y.1.0.0

Each of those directories has the nupkg file and the nupkg file fully expanded. So far so good.

I then run the command:

nuget update -source http://myfeed/api/v2 -verbose c:\MyLibrary\MyLibrary.sln

I see the output:

Looking for updates for 'x'...

No updates available for 'x' in project 'MyLibrary'.

Updating 'y' from version '1.0.0' to version '1.0.1' in project 'Mylibrary'.

Successfully removed 'y 1.0.0' from 'MyLibrary'.

Successfully added 'y 1.0.1' to 'MyLibrary'.

When I look at c:\MyLibrary\packages\y.1.0.1 I see y.1.0.1.nuspec & y.1.0.1.nupkg, but no other files or directories (like the lib directory).

If I open my solution and try to compile, I get errors saying the reference to Y is missing.

If I re-do the above procedure with a fresh checkout of MyLibrary and then add another install:

nuget install -source http://myfeed/api/v2 -solutiondir c:\MyLibrary c:\MyLibrary\MyLibrary\packages.config

I get the message:

All packages listed in packages.config are already installed.

Looking at the package\y.1.0.1 directory, I still don't see the fully expanded package. When I open the solution it still says reference Y is missing.

Is this workflow supported? Is it valid? Is this the correct behavior for a nuget update? Do you have any suggestions for improving this process?

I am using Nuget.exe v2.1.31002.9028 which I retrieved using the NuGet command line bootstrapper.

Oct 9, 2012 at 8:07 PM

Everything you described above should be valid in general, and the question I'm curious about is whether there's any special installation logic for package 'y'.  If there is, could you add logging to init.ps1 and see if you can try to catch the point of failure?

HTH,
Clay

Developer
Oct 9, 2012 at 8:26 PM

Isn't this the same problem as http://nuget.codeplex.com/workitem/2411?

Oct 9, 2012 at 8:36 PM

It is the same problem in work item 2411. I guess my question is it currently possible to completely update packages in a solution using the NuGet command line?

 

There is no special installation logic in any of the packages.

Developer
Oct 23, 2012 at 6:44 PM

I checked in a fix for this as part http://nuget.codeplex.com/workitem/2693. Do you think you could pick up the CI build from 2.1 (https://ci.nuget.org) and see if this scenario works for you? The update command should now install and expand the package.

Oct 23, 2012 at 6:52 PM

Sure. I’ll look at this this afternoon.

Thanks,

Clay

From: pranavkm [email removed]
Sent: Tuesday, October 23, 2012 10:44 AM
To: Clay Compton
Subject: Re: NuGet Update broken in v2.1? [nuget:398569]

From: pranavkm

I checked in a fix for this as part http://nuget.codeplex.com/workitem/2693. Do you think you could pick up the CI build from 2.1 (https://ci.nuget.org) and see if this scenario works for you? The update command should now install and expand the package.

Oct 24, 2012 at 1:25 AM

It looks like with this change, file references aren’t getting updated in project files. Try the following:

1. Create a C# console application.

2. Install JQuery UI, which will chain in an old version (1.4.4) of JQuery.

3. Save your solution and close VS. If you examine the .csproj file in Notepad, you’ll see Content elements for each JS file in JQuery and JQuery UI.

4. Using the latest NuGet.exe from the CI machine, call NuGet update –verbose <path to .sln>. This will install the latest version of JQuery.

5. Open the .csproj file in Notepad. The file reference to JQuery will still be to the 1.4.4 version.

-Clay

From: pranavkm [email removed]
Sent: Tuesday, October 23, 2012 10:44 AM
To: Clay Compton
Subject: Re: NuGet Update broken in v2.1? [nuget:398569]

From: pranavkm

I checked in a fix for this as part http://nuget.codeplex.com/workitem/2693. Do you think you could pick up the CI build from 2.1 (https://ci.nuget.org) and see if this scenario works for you? The update command should now install and expand the package.