2

I'm porting my applications from VS2015 to VS2017 and trying to figure out the right migration path. I'm also moving my web services to .NET Core to take advantage of deploying to Linux or Windows servers. I see that I have the option of creating base libraries in .NET Standard or .NET Core. Is there any advantage to a .NET Core library or should I create the base libraries in .NET Standard by default?

3 Answers 3

6

Practically speaking, .NET Standard 2.0 is the intersection of .NET Framework 4.6.2(-ish) and .NET Core 2.0.

If you build a library targeting .NET Standard 2.0 then your library can be consumed by .NET Framework libraries and applications, as well as .NET Core libraries and applications. That's the advantage of Standard.

But there are several types/members that have been added to .NET Core which aren't part of .NET Standard. If you want to use something like the new CertificateRequest class you'd need to explicitly target .NET Core.

.NET Core allows new things to get to users faster than .NET Framework does, so the general tradeoff will always be ".NET Standard => more places; .NET Core => newer things".

Sign up to request clarification or add additional context in comments.

1 Comment

I would agree with this. It appears there are certain packages that will only work with .NET Core, so if your library needs to use one of these packages, then you have a reason to use .NET Core. Otherwise, it looks like .NET Standard is what we should use for shared libraries.
-2

.Net Standard is just package with interfaces with can be used to provide compatibility across .Net Framework, .Net Core and others

2 Comments

Thanks, but I have a general idea what it is. Given that, is there any advantage to selecting .NET Core for a library type over .NET Standard? Given the universality of .NET Standard, under what condition would you want to select .NET Core for a base library?
If you know what it is you should know what is best for you. If you will pick .Net Standard then you need to provide implementation of this iterfaces (for exaple .Net Core or .Net Framework) and can use Nuget packages for .Net Standard but remember - Only .Net Core implementation is fully multiplatform. So if you want deploy your app to Linux or Windows then pick only .Net Core or .Net Standard with only .Net Core
-2

I wouldn't choose a .NET Core library. The differences are in the referenced libraries:

  • the .NET Standard library references the netstandardX.X NuGet meta-package
  • the .NET Core library references the netcoreappX.X NuGet meta-package

The netcoreapp package also includes some .NET Standard packages, but also a bunch of .NET Core App specific packages (including libuv. Don't know why a library needs libuv.)

So the .NET Standard library is for cross platform and the .NET Core library just for .NET Core

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.