Buggy behavior testing a package

May 19, 2011 at 2:18 PM

Considering how many packages use NuGet I can only assume it's me doing something wrong, so if anyone could point me in the right direction it'd be appreciated.

I'm trying to test my package locally using "Install-Package -source <dir> ID" from the Package Manager Console. The installation is going fine, but I'm having a few issues uninstalling:

  • I can't uninstall it from the console (Uninstall-Package -Id "<package-id>"). When I try I get "Uninstall-Package : You must provide a value expression on the right-hand side of the '-' operator."
  • The libraries in my lib folder (added via the nuspec) are being locked and not removed, but the uninstallation completes (I see warnings in the dialog before it closes). In fact, I have to close Visual Studio before I can delete them.
  • My uninstall script (which removed an msbuild import) isn't being executed. If I run the script in the console (after setting $project), it works as expected

My configuration isn't complicated so I'm not sure why everything is going wrong. Should I not be testing from the file system like this?

Cheers,
Richard

May 19, 2011 at 2:54 PM

The solution to #2 was setting up the local folder as an "online source" and using the NuGet GUI rather than the console

#3 was a bug in my installation script

I still have no solution for #1, but at least I can test the package properly now.

Coordinator
May 19, 2011 at 3:51 PM

What is the exact command you are running to uninstall? For example, if you package was named MyCoolPackage, you should run:

Uninstall-Package MyFooPackage

Or

Uninstall-Package -MyFooPackage

Works on my machine. J

May 19, 2011 at 3:53 PM

That's the exact command I'm running. I've also tried explicitly specifying -Id and quoting the package ID.

Coordinator
May 19, 2011 at 3:54 PM

What’s the package name?

Care to attach it to this discussion?

May 19, 2011 at 4:00 PM

The package name is WP7-CI

Coordinator
May 19, 2011 at 4:03 PM

Hmm, I could not reproduce this. Type $host in your package manager console and let us know what it says. Maybe this was fixed in our upcoming NuGet 1.4 release. J

May 19, 2011 at 4:08 PM
Edited May 19, 2011 at 4:08 PM

It's working again now and I know why. There was an error in my Uninstall.ps1 and it was only being surfaced via the console. Should it not also show up in the GUI?

Thanks for your assistance Phil.

Coordinator
May 19, 2011 at 4:13 PM
Yeah, the behavior should be similar. When using the GUI, was there any output in the Output window in VS? That's where the GUI output goes. Just select Package Manager in the drop down.
>
May 19, 2011 at 4:19 PM

Thanks for the tip, I hadn't noticed that.

Actually when the uninstall was previous failing due to either issue (the locked file or the failing uninstall script), the package was still "removed" from the list of installed packages.

Coordinator
May 19, 2011 at 4:56 PM

I’m going to guess that’s by design. If you think it shouldn’t have removed it, log an issue with a minimal repro if you don’t mind. J