Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the nuget package that contains an assembly?

I feel like a) I should know the answer already and b) this would be a common question, but I can't find the answer.

I want to use Microsoft.AspNetCore.Http.HttpRequest in a .NET Standard 2.0 class library project. Ok, I guessed I might need the Microsoft.AspNetCore package, but no that class isn't in any assembly in there apparently.

I can go on MSDN and see that the HttpRequest class is in

Namespace:
Microsoft.AspNetCore.Http
Assembly:
Microsoft.AspNetCore.Http.Abstractions.dll

So how do I find the package that holds Microsoft.AspNetCore.Http.Abstractions.dll?

I'm asking for the methodology, not just the package.

like image 615
Jim W says reinstate Monica Avatar asked Sep 16 '25 16:09

Jim W says reinstate Monica


2 Answers

From within Visual Studio, you can open the Nuget Package Manager and search for the class you want to use and the results will populate with the package you need.

Unfortunately, it doesn't seem Microsoft has provided a way to see exactly what assemblies are included in a package, but the publisher will sometimes include that information in the package description, like Microsoft has in the example below:

like image 125
Brian Aarhus Avatar answered Sep 18 '25 10:09

Brian Aarhus


You could try:

https://www.nuget.org/packages?q=Microsoft.AspNetCore.Http.Abstractions

The result is: enter image description here

like image 40
tymtam Avatar answered Sep 18 '25 08:09

tymtam