22

Can i open a core 2.0 project in Visual Studio 2017?

I've installed the latest dotnet-core (2.0.0-preview2-005840) and created a core 2.0 console-app.

mkdir dn2cli
cd dn2cli
dotnet new console
dotnet restore
  • Open console.csproj in Visual Studio 2017 with "open project"
  • Clean and Build Solutions
  • i get several erros
    • amongs others:

Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0'.

So. Is it just not supported at the moment or am i missing something?

c:\Temp>dotnet --info 
.NET Command Line Tools (2.0.0-preview2-005840)

Product Information:  Version:            2.0.0-preview2-005840 
Commit SHA-1 hash:  8f2fcef544

Runtime Environment:  OS Name:     Windows  OS Version:  10.0.14393 
OS Platform: Windows  RID:         win10-x86  Base Path:   C:\Program
Files (x86)\dotnet\sdk\2.0.0-preview2-005840\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview1-002061-00   Build    :
2b70ec9c3b014af0c2a5f45de0e5b73a1ae51c09
juwens
  • 3,729
  • 4
  • 31
  • 39

4 Answers4

17

Update:

There is now a VS 2017 15.3 preview that resolves this issue. Starting with VS 15.3, Visual Studio carries an MSBuild SDK resolver that determines which version of the CLI SDK a project would use (e.g. if a global.json sets the version) and uses it's MSBuild targets so new previews are picked up by VS.

Original:

You can modify your environment to get VS 2017 support for the unreleased 2.0 tooling by setting the MSBuildSdksPath as described in https://github.com/aspnet/Announcements/issues/231 so that VS picks up the build logic from the CLI.

Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217
  • Works perfect. Your path may vary eg: "C:\Program Files (x86)\dotnet\sdk\2.0.0-previewX-00xxxx\Sdks" – juwens Apr 27 '17 at 17:58
3

The Visual Studio .NET Core tools were just released in March, yet the 2.0 preview you are using was released in April. https://blogs.msdn.microsoft.com/dotnet/2017/03/07/announcing-net-core-tools-1-0/ You'll need to wait for an update to the .NET Core Tools before you can use Visual Studio with .NET Core 2.0

Novaterata
  • 4,356
  • 3
  • 29
  • 51
1

Visual Studio 2017 Version 15.3 Released and .NET Core 2.0 also Released with nuget v4.3 and the problem is resolved completely.

you can review all fixes Release notes

M.Hassan
  • 10,282
  • 5
  • 65
  • 84
  • I'm still experiencing the same problem under Windows-10: my VS-2017-3.5.3 cannot create any new project targeted for.`net-sdk-2.0.0`, only `1.x.x` versions. – ankostis Sep 22 '17 at 09:14
  • Do you installed https://www.microsoft.com/net/download/core? net-sdk2 isn't shipped with vs 2017.3.When you right click properties of project, do you see netstandard2? – M.Hassan Sep 22 '17 at 11:31
  • If you installed ns2 from https://www.microsoft.com/net/core, it didn't show in visual studio 2017.3, but if you installed from https://www.microsoft.com/net/download/core it showed in visual studio. ref:https://github.com/dotnet/core/issues/961 – M.Hassan Sep 22 '17 at 18:49
0

Landed on this today (April 2019) and it appears that now there is a version of .NET Core Tools SDK for VS 2017. Here's how you get to it: 1. browse to http://dot.net 2. Under .NET Core 2.2, look for "Download .NET Core SDK (Compatible with Visual Studio 2017" 3. Visual studio 2017 (I have version 15.9.11) should now list .NET Core 2.2 as a target framework

enter image description here

Sudhanshu Mishra
  • 6,523
  • 2
  • 59
  • 76