2

I have read that .net Core is cross platform, this means that a class library that uses .net Core can work in windows, linux and mac.

But my doubt is if a .net standard class library can be run also in many platforms (many OS or not) like .net Core library or are different? Or .net standard is for compatibility between platforms like UWP, android... etc?

Because when I read cross platform, sometimes it is means between different OS (windows, linux, mac) and sometimes it means between kind of applications (android, windows, UWP), so it is a bit confused for me.

Thanks.

Álvaro García
  • 18,114
  • 30
  • 102
  • 193

1 Answers1

8

.NET Standard is a specification. A library compiled for a specific .NET Standard version can be used in different .NET Standard implementations.

The concept of cross-platform is not strictly bound to .NET Standard, but is inherent of the frameworks that implements it in a specific version.

A platform is generally speaking a combination of:

  • OS (Windows, Linux, Android, iOS)
  • Runtime (.NET Framework, .NET Core, JavaVM, etc.)
  • Architecture (x86, x64, ARM, etc.)

So .NET Standard is as cross-platform as its implementations. Look at them and then you may certainly say if it is multi-platform or not.

Federico Dipuma
  • 17,655
  • 4
  • 39
  • 56
  • Then, if I create a .net standard, that can be used in many OS (linux, windows, mac) and in many kind of applications (android, UWP, windows), why to use .net Core it can't be use in many kind of applications? When it is more useful .net Core than .net Standard? – Álvaro García May 20 '17 at 15:40
  • 1
    .NET Core is an implementation of .NET Standard, and its APIs are a **superset** of the APIs specified in .NET Standard. So you need a .NET Core project every time you have to use .NET Core specific APIs (which are not part of .NET Standard). If, instead, your library uses only APIs specified in .NET Standard then your best choice is to compile it using that specification. – Federico Dipuma May 20 '17 at 15:42