10

I'm trying to get started with .NET Core and I'm really having some headaches to understand all this new naming scheme.

Looking at the wiki netcoreapp1.0 targets the .NET Standard Library 1.6, however when I try to add the netstandard1.6 instead of netcoreapp1.0 I get a package restore failed because Microsoft.NetCore.App does not support netstandard1.6.

Is it because is delcared like this?

"Microsoft.NETCore.App": {
  "version": "1.0.0",
  "type": "platform"
},

Also, what does type "platform" means?

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
Paleta
  • 970
  • 2
  • 13
  • 27

1 Answers1

10

What you use and reference depends on whether you are building an application, or a shared library:

  • If you are building an application (console, UWP, ASP.NET Core web app), you'll target netcoreapp1.0 and depend on Microsoft.NetCore.App. type: platform tells NuGet that you are referencing a platform, which doesn't get installed as a package. netcoreapp1.0 imports netstandard1.6, which means it can use libraries that also target netstandard1.6 or below.

  • If you are building a library (to be consumed by another library or application), you'll target netstandard1.X and either depend on NETStandard.Library or directly reference the NuGet packages you need.

Thomas
  • 5,080
  • 27
  • 42
Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
  • I've seen on the wiki that netcoreapp1.0 is covers netstandard1.6 and net463 also does that, but the net framework 4.6.3 has not been released right? – Paleta Jul 03 '16 at 00:58
  • @Paleta According to [this document](https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md#mapping-the-net-platform-standard-to-platforms), `net463` will map to `netstandard1.6`. You're right, it hasn't been released yet. – Nate Barbettini Jul 03 '16 at 01:15
  • @NateBarbettini Can you clarify in your answer that `Microsoft.NETCore.App` NuGet requires the tfm `netcoreapp`. The `NETStandard.Library` NuGet requires the tfm `netstandard`. Therefore, a `netcoreapp` (which behind the scenes imports `netstandard`) can use both NuGets, while a `netstandard` library can only refer `NETStandard.Library`. – Thomas Jul 04 '16 at 22:04
  • @Thomas I'm not quite sure what you mean. My answer already states that `netcoreapp` and `netstandard` are targeted (respectively). Can you elaborate on what you mean by "use both NuGets"? – Nate Barbettini Jul 04 '16 at 22:06
  • 1
    netcoreapp1.0 Imports netstandard1.6 which again Imports netatandard1.5 which again Imports netstndard1.4 etc. As a consequences a netcoreapp1.0 can use a netstandard1.5 library but not the others way around. The package `Microsoft.NetCore.App` requires netcoreapp1.0. that is the reason why netstandard1.6 cannot be set above for the project. – Thomas Jul 06 '16 at 05:31