This document covers the steps required in order to use build and run .NET Core 2.0 and .NET Standard 2.0 projects with Visual Studio for Mac.
If only the .NET Core 2.0 SDK is installed then the projects will fail to run due to the 1.1 runtime being unavailable. To target .NET Core 2.0 the TargetFramework in the project will need to be edited to target netcoreapp2.0 or netstandard2.0. Alternatively the dotnet cli installed with the .NET Core 2.0 SDK can be used to create the project with the correct dependencies and target framework.
Package restore will fail to resolve 'Microsoft.NETCore.App (>= 2.0.0)'.
The RuntimeFrameworkVersion needs to be added to the project for restore to complete successfully.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>2.0.0-preview1-002111-00</RuntimeFrameworkVersion>
</PropertyGroup>
</Project>
By default the .NETStandard.Library 1.6.1 package will be used since the .NET Core sdk files that ship with Mono's MSBuild define that as the default version.
A workaround is to add the NETStandardImplicitPackageVersion to the project.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<NETStandardImplicitPackageVersion>2.0.0-preview1-25301-01</NETStandardImplicitPackageVersion>
</PropertyGroup>
</Project>