mrward/monodevelop-nuget-addin

NuGet Package Manager Console

pipermatt opened this issue · 5 comments

This is less an issue and more of a discussion question. I am using ServiceStack v3.9.71 (BSD license) for an internal project. ServiceStack recently released v4.0, which was released under a commercial license. 3.9.71 remains available under the BSD license. However it requires use of the NuGet Package Manager Console to install. (See here: https://github.com/ServiceStackV3/ServiceStackV3)

My question is how much effort would it take to create a Console interface for Xamarin & SharpDevelop? I may be interested in helping with such an endeavor, but I won't have time to look at it until next week. Just wanted to start the discussion about whether there is significant enough value in doing it.

SharpDevelop has a Package Manager Console.

I assume what you are talking about is a package manager console that does not use PowerShell but allows you to run a command such as:

Install-Package ServiceStackV3 -Version 3.9.71

The main reason the MonoDevelop addin does not have one is there is no PowerShell support. I have worked a bit with Pash, which is an open source implementation of PowerShell, but it is still in alpha and it currently works only for simple NuGet packages, such as the MVC Profiler. There is still a lot of work still required which is why there is no console available for MonoDevelop and Xamarin Studio.

What we probably need is a way to install a specific version of a NuGet package possibly from the dialog itself.

Yep... that would take care of it well and would add a lot of value for the effort required I think. I'll take a look next week when I have some more time.

Hi mrward,

After you answered my StackOverflow question yesterday about Code Snippets, I remembered that I never came back and looked at this… so I played around with it some last night.

IPackageRepository.FindPackagesById returns a list of all the package versions that match the packageId, so for instance:

string packageId = "ServiceStack";

IPackageRepository repo = PackageRepositoryFactory.Default.CreateRepository("https://packages.nuget.org/api/v2");
List<IPackage> packages = repo.FindPackagesById(packageId).ToList();
packages = packages.Where(item => (item.IsReleaseVersion())).OrderByDescending(item => item.Version).ToList();

foreach (IPackage p in packages) {
    Console.WriteLine(p.Version);
}

Produces the following output:

4.0.18
4.0.17
4.0.16
4.0.15
4.0.14
4.0.13
… (etc)

Perhaps the simplest solution would be to replace the packageVersionTextBox in the PackagetsWidget with a ComboBox that defaults to the most recent version. This would allow you to choose an older version and then click add.

Thoughts?

A drop down combo box or a way to search for a package version are two possibilities.

The current plan is to allow the user to search for a package and specify that they want all versions or a range of versions. This is done in the dialog itself.

Hopefully this will be included in the next release of Xamarin Studio.

Xamarin Studio 5.1 now has the ability to search for and install specific package versions from the Add Packages dialog. The searching is done through a NuGet style search syntax:

PackageId version:number

Examples:

NUnit version:*
NUnit version:2.6
NUnit version:2.6.1

The first example will return all NUnit versions.
The second example will return all NUnit 2.6.* versions.

Also there is a new NuGet extension addin that adds some experimental features to the built-in NuGet support. One feature is support for a Package Manager Console window that works on the Mac. It uses Pash an cross platform PowerShell re-implementation. The NuGet commands work but there are some missing features in Pash which you may run into.