12
votes

I have a project(x) that targets the NetStandard.Library 2.0 and a console app that targets netcoreapp2.0.

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <PropertyGroup>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.0" />
    <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
    <PackageReference Include="NETStandard.Library" Version="2.0.0-beta-25021-01" />
    <PackageReference Update="Microsoft.NETCore.App" Version="2.0.0-beta-001588-00" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\x.csproj" />
  </ItemGroup>

</Project>

Project X:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.0" />
  </ItemGroup>


  <ItemGroup>
    <PackageReference Update="NETStandard.Library" Version="2.0.0-beta-25017-01" />
  </ItemGroup>
</Project>

When I compile the console application I get the Error:

Project x is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win-x86. Project x supports: netstandard2.0 (.NETStandard,Version=v2.0)

I have installed: Microsoft net core 2.0.0 runtime located here: https://github.com/dotnet/core-setup but it still doesnt build.

*edited following advice from below: I have installed the Alpha SDK located here: https://github.com/dotnet/cli/tree/master#installers-and-binaries and I still get the same error.

enter image description here

The interesting thing is that there is a nuget package reference for Microsoft.NETCore.App which I cannot remove: enter image description here

4
It is not yet even previewed. Don't attempt unless you are ready to learn from the code and its GitHub repos. - Lex Li
..\x.csproj ... Is not the x project containing all source from your web project? - Thomas
@CodeJunkie and that's why I left a comment. When something is being cooked, there is no concrete answer. - Lex Li
Thomas, x.csproj is a class library referenced by my web project. That is the full file. - Code Junkie

4 Answers

6
votes

.NET Core 2.0 will require the .NET Core 2.0 SDK. Download links to nightlies are available here: https://github.com/dotnet/cli/tree/master#installers-and-binaries

Heads up: nightly builds of this are very unstable right now. As of February 2017, .NET Core 2.0 has no public release. Checkout https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/dogfooding.md for instructions on using nightlies.

1
votes

.NET Core 2.0 SDK (final release) is available including tools for vs 2017 /2015.

You can download and it's integrated with vs 2017.3

Note that if you installed this version: dotnet-sdk-2.0.0-win-gs-x64, it didn't show in visual studio 2017.3,ref

For feature details read: Announcing .NET Core 2.0

Also, ASP.NET Core 2.0 is available

0
votes

.NET Core 2.0 is not on the Download page and it is expected to be released in Q2 2017 on the roadmap.

You should use .NET Core 1.1 and target .NET Standard 1.6 for now.

And yes: you must download the SDK if you want to develop.

0
votes

if you have both Core and DotNet 4.X within the same solution, you may want to consider adding netcoreapp2.0 to your "<\TargetFramework>" tag.

<Project Sdk="Microsoft.NET.Sdk">
 <PropertyGroup>
 <TargetFramework>netstandard2.0;netcoreapp2.0</TargetFramework>
</PropertyGroup>