mrward / monodevelop-nuget-extensions

Extends the MonoDevelop NuGet addin
MIT License
72 stars 9 forks source link

Uninstall-Package - Argument cannot be null. #4

Open omares opened 9 years ago

omares commented 9 years ago

When trying to remove an existing nuget package from a project i get following input:

PM> Uninstall-Package FAKE
Removing ...
Argument cannot be null.
Parameter name: packageId

Am i missing something?, or is this an error?

Running the package manager console using:

Xamarin Studio
Version 5.9.3 (build 1)
Runtime:
    Mono 4.0.1 ((detached/ed1d3ec)
    GTK+ 2.24.23 (Raleigh theme)

    Package version: 400010044

Operating System
Mac OS X 10.10.3
mrward commented 9 years ago

The error seems to be misleading. If I try the same thing with SharpDevelop it shows a better error message which is that it cannot find the FAKE package. In Xamarin Studio I get the argument cannot be null error if I try to uninstall a NuGet package that is not installed, which is a bug.

The problem is that the Fake NuGet is a solution level package which is not installed into a particular project. Currently Xamarin Studio does not have good support for these types of NuGet packages. It currently only looks at the project. You cannot uninstall these types of NuGet packages directly from Xamarin Studio using the built in support either.

I will look at adding support for these types of NuGet packages into the package manager console.

omares commented 9 years ago

Thank you :+1:

mrward commented 9 years ago

Version 0.9 of the NuGet extensions has been published and it supports uninstalling solution level NuGet packages. There is one limitation on the Mac currently where the package id passed to Uninstall-Package needs to match the case of the package id used in the .nupkg file. So Uninstall-Package fake does not work and will fail to find the NuGet package, but Uninstall-Package FAKE will work.