3

Given an assembly I need, how do I find the NuGet package that provides it?

For example, I'm using ASP.NET Web API and I need the definition of DelegatingHandler. In a painful manner, I determine that this is available in the NuGet package Microsoft.Net.Http. But then, by accident, I discover it is also available in the latest (4.0.0) version of System.Net.Http.

There should be an easier way to locate the NuGet package or packages that provide the type rather than having a stumbling and guessing exercise with google.

Right now I also need the type System.Net.Http.ObjectContent, which is found in assembly System.Net.Http.Formatting. However, I'm not sure which NuGet provides it. I should not need to guess, but I'm going to guess that the relevant package is Microsoft.AspNet.WebApi.Client. Unfortunately, that package lists Microsoft.Net.Http as a dependency, rather than the version 4.0.0 of System.Net.Http which I have chosen for my other Web API dependencies.

So I'm kinda stuck trying to figure out what NuGet package or packages to grab.

Is there a "Reverse NuGet Lookup" tool I'm overlooking that would simplify this search?

Community
  • 1
  • 1
Brent Arias
  • 29,277
  • 40
  • 133
  • 234

1 Answers1

3

There's the Reverse Package Search website but it includes only some of the NuGet packages, mostly those from BCL and ASP.NET: http://packagesearch.azurewebsites.net/

In addition, if you are using Visual Studio with the latest tooling, you should be able type a type name and intellisense will tell you what package to add. For example, type IApplicationRuntime, press ctrl + . and you'll get a suggestion for Microsoft.Dnx.Runtime.Abstractions.

Victor Hurdugaci
  • 28,177
  • 5
  • 87
  • 103