Sdk: What is the correlation between netcoreapp and netstandard?

Created on 19 Jun 2016  路  9Comments  路  Source: dotnet/sdk

What is the correlation between netcoreapp and netstandard as referencing netstandard in netcoreapp does not work?

question

Most helpful comment

How do you mean? You should be able to reference a netstandard library in your netcoreapp application, otherwise something is wrong. can you post your project.json? also, what error are you getting?

To awnser your specific question, netstandard is for libraries and establishes a baseline that diffrent implementations(.net 4.5, .net 4.6, uwp and so on) can support. netcoreapp on the other hand is for .net core applications specifically. Using it you can use libraries from all the netstandard levels below netstandard 1.6

check out https://github.com/dotnet/core-docs/blob/master/docs/concepts/dotnet-standard-library.md for more details

All 9 comments

How do you mean? You should be able to reference a netstandard library in your netcoreapp application, otherwise something is wrong. can you post your project.json? also, what error are you getting?

To awnser your specific question, netstandard is for libraries and establishes a baseline that diffrent implementations(.net 4.5, .net 4.6, uwp and so on) can support. netcoreapp on the other hand is for .net core applications specifically. Using it you can use libraries from all the netstandard levels below netstandard 1.6

check out https://github.com/dotnet/core-docs/blob/master/docs/concepts/dotnet-standard-library.md for more details

@xperiandri Also helpful ... https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf1b7

... but in need of an update (netstandard1.6) :wink: cc/ @davidfowl

I'll post a reproduction solution later today

Tried it with this solution.
https://github.com/xperiandri/ev3dev-lang-csharp

At first it did not build. But then I used import netstandard1.5 and it built.
So I deleted import netstandard1.5 and now it builds even without that.
I have no idea what was wrong.

I'm seeing some of the same types of things. i have a "netcoreapp1.0" referencing a "netstandard1.6", and until i restarted my machine, they built and worked fine. now i can't get them to build or have intellesence between them. suggestions?

well restarting VS now lets me build and run it with red squiggles in intellesense. Guess i'll call that a win. lol, it ran though the code and worked as i expected it to.

@brentdavid2008

a "netcoreapp1.0" referencing a "netstandard1.6"

It might just be the brevity of your comment, but that description wasn't clear. If you're creating a CoreCLR application, you would use the netcoreapp1.0 TFM, which implements netstandard1.6 (currently). There is no need to have netstandard1.6 "referenced" explicitly with the netcoreapp1.0 TFM. netstandard1.6 would be the TFM to use for creating CoreCLR packages.

I may not have been very clear, sorry about that.

Maybe the way visual studio creates them is causing the confusion. I created a web app, saw the project.json file was saying the framwork is "netcoreapp1.0" then created a class library and the project.json's framework node was "netstandard1.6". When i attempt to reference that class library, and use it with some using statements, i get no intellesense and the build failed. however, like i said on the last comment, restarting vs fixed it, but i still had no intellensense, but at least it built and let me run it to test it.

Gotcha. AFAIK Intellisense should work in your scenario. If you don't have it configured, you may need a global.json in the project. All of my libs are NuGet packages these days and I'm still using VS Code, so I'll defer to others to assist further. To get more Tooling :eyes: on this, you can close here and open over in the Tooling repo, where all of the Tooling :cat:'s hang out.

Was this page helpful?
0 / 5 - 0 ratings