Juarrow
Juarrow

Reputation: 2384

Check if package is compatible with .net core

I started programming with .NET Core and ASP.NET Core and after reading many Docs/Tutorials i still am not sure of how to realize if a Nuget-(Meta-)Package is comptabile/usable within my .NET-Core-App.

  1. How to check if a NuGet-Package is compatible with .NET Core. E.g. the often recited Newtonsoft JSON. Is it compatible/usable - and how to see this?
  2. Is there a list of all the available .NET Core packages?

(Like here it lists a few

key NuGet packages for .NET Core

). But since they say those are "key" packages i would assume there are more. But which?

Upvotes: 9

Views: 6437

Answers (4)

Vlad
Vlad

Reputation: 164

The best way to understand compatibility is table here

In this table you can check what API version support NuGet package. If it is standard 1.0+ - it works with .Net Core

For checking (supported API version) dependencies on your package, you can check page of package on nuget.org or in your package manager

Here is an example for Rider

Upvotes: 3

winters0
winters0

Reputation: 86

maybe that will be helpful - lots of popular packages https://github.com/thangchung/awesome-dotnet-core

I also don't see nuget.org mentioned anywhere so: https://nuget.org

General rule of thumb for me is: if package has a dependency on net standard or .net core, it will run with .net core(mind the versions also)

Upvotes: 0

Shad
Shad

Reputation: 57

Well, in fact you don't have to worry, the NET core application will indicate you if the package is compatible or not when you will run a dotnet restore command in your project.

Let say that you have the famous CSVHelper package registered in your csproj file :

<PackageReference Include="CsvHelper" Version="0.12.0"/>

Then, when you'll run any dotnet command such as build or run, you'll have the following input in the console in case of, here, cross-compatibility:

YourProjet/aspnetapp.csproj : warning NU1701: Package 'CsvHelper 0.12.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v2.2'. This package may not be fully compatible with your project.

Basically, it mean that NET Core application can use ASP.NET NuGet package, and so far, I've never cross on a non-compatible package. Even if version is incorrect, the build will get the most recent matching version of the NuGet package.

Hoped it answer your question.

Upvotes: -1

lazy
lazy

Reputation: 531

https://packagesearch.azurewebsites.net

Go to site and search for package to find its compatibility

Upvotes: 0

Related Questions