NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

Expose package metadata in PM Console #6002

Open jmezach opened 7 years ago

jmezach commented 7 years ago

This is not so much an issue, but more of a discussion topic. It would be nice if more of the package's metadata was exposed inside the Package Manager Console. Currently only the package ID, version and license URL are available when using Get-Package for a locally installed package for example. But we do not have other metadata, such as tags. Neither do we have the install location for the package.

The reason I'm asking is because we currently have a set of PowerShell scripts that can be run in the package manager console that handle deployment of a so called database package, which is just a NuGet package with a specific set of files. Currently I'm discovering the packages folder manually and using the old LocalPackageRepository API to get additional metadata. This has worked fine for us with Visual Studio 2015, but it doesn't work so well for 2017 and with all the changes going on under the hood (no more packages folder and packages.config) we're having trouble moving forward.

If more information would be available in the PM console when I do Get-Package that would make this a lot easier to do. Is this something worth considering?

rohit21agrawal commented 7 years ago

@jmezach thanks for the feedback! We will take it under consideration. Currently, may i suggest using our APIs to parse the nuspec file yourself and getting all the metadata you need.

Let me know if you need a working example.

jmezach commented 7 years ago

@rohit21agrawal I would love to do that, but the problem is that I can't figure out where the package is located on disk. With packages.config this can be discovered relatively easily because the package will always be in the packages folder inside the solution directory. However, with PackageReferences this isn't true anymore and it can be in a totally different place.

In fact, I even need to know if the project is using packages.config or PackageReferences. I couldn't find an API that I can use to discover that from the Package Manager Console. We are still using packages.config for now, but we would like to move to the PackageReferences world at some point in the future.