What is the difference between .NetCoreApp and .NetStandard.Library?

.Net Core 1.0 was released a couple of days ago, and I started playing with it. I created a simple solution with one project (class library => .NetStandard.Library), and secondly, a console application (.NetCoreApp). The fact is that the console application has a link to the library, but I cannot use the types that make up this library. Are these two frameworks incompatible? Did I miss something?

project.json for console application:

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "ConsoleApplicationLibrary": "1.0.0-*",
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.0"
    }
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": "dnxcore50"
    }
  }
}

project.json for the library:

{
  "version": "1.0.0-*",

  "dependencies": {
    "NETStandard.Library": "1.6.0"
  },

  "frameworks": {
    "netstandard1.6": {
      "imports": "dnxcore50"
    }
  }
}

I realized that it works, and the code compiles, but the visual studio still allocates types from the library as unknown.

+4
source share
4 answers

, .NET Core , ConsoleApplicationLibrary NuGet. , "ConsoleApplicationLibrary": {"target": "project", "version": "1.0.0-*"}.

.

+1

, , resharper, VS , . , prolem resharper .net. (resharper v.9.1.3). : resharper ultimate blog , ​​.net .

+1

.NetCoreApp - , .NetStandard.Library - , - ( ) .NET.

You can include a direct link (package) NetStandard.Library in any of your .NET platform projects that is supported for ex.NETCoreApp (Dot Net Core 1.X)

Link: https://docs.microsoft.com/en-us/dotnet/articles/standard/library

+1
source

I had the same problem and it turned out that I needed to update Resharper to the latest version. I had v9.1.1, so I updated it to 2016.3.2 and fixed the problem.

0
source

All Articles