Simple example does not work


#1

Hello, I am a begginer an the .net core, and I am trying to write a simple helloworld project (https://dotnet.github.io/docs/scenarios/solution-authoring/cli-golden-path.html) on my mac. I have installed the latest version of the dotnet.
The first step (Writing the library) was done soccessful, but the two another steps fall.
the “Writing the test project” fails on “dotnet restore” with this errors:
error: Project Library is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Project Library supports: netcoreapp1.5 (.NETCoreApp,Version=v1.5)
error: Package xunit.abstractions 2.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package xunit.abstractions 2.0.0 supports:
error: - net35 (.NETFramework,Version=v3.5)
error: - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
error: Package Microsoft.DiaSymReader 1.0.6 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.DiaSymReader 1.0.6 supports:
error: - net20 (.NETFramework,Version=v2.0)
error: - portable-net45+win8 (.NETPortable,Version=v0.0,Profile=Profile7)
error: One or more projects are incompatible with .NETCoreApp,Version=v1.0.
error: One or more packages are incompatible with .NETCoreApp,Version=v1.0.

and the last one fails at the same command with this errors:
error: Project Library is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Project Library supports: netcoreapp1.5 (.NETCoreApp,Version=v1.5)
error: One or more projects are incompatible with .NETCoreApp,Version=v1.0.

I am a new at the dotnet core, and I have not found some another articles of building solutions without the VS.


#2

What is your project.json file?


#3

the project.json of TestProject is:
{
/“testRunner”: “xunit”, /
“version”: "1.0.0-
",
“dependencies”: {
“Microsoft.NETCore.App”: {
“type”: “platform”,
“version”: “1.0.0-rc2-3002702”
},
“Library”: {
“target”: “project”,
“version”: "1.0.0-
"
},
“xunit”: “2.1.0”,
“dotnet-test-xunit”: “1.0.0-rc2-build10025”
},
“frameworks”: {
“netcoreapp1.0”: {
“imports”: “dnxcore50”
}
}
}


#4

Modify it for frameworks & dependencies as:

"frameworks": { "netcoreapp1.0": { "imports": "dnxcore50" }, "netstandardapp1.5":{ "imports":"dnxcore50" } }

"dependencies": { "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-rc2-3002702" }, "NetStandard.Library":"1.5.0-rc2-*" }


.NET Foundation Website | Blog | Projects | Code of Conduct