Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

netcoreapp2.0 with netstandard2.0

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

like image 323
Code Junkie Avatar asked Feb 24 '17 19:02

Code Junkie


2 Answers

.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.

like image 90
natemcmaster Avatar answered Oct 12 '22 22:10

natemcmaster


.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

like image 41
M.Hassan Avatar answered Oct 12 '22 22:10

M.Hassan