50

How Can I open .Net Core 3.0 project in Visual Studio 2017?

I have downloaded the .NET Core 3.0 SDK from dotnet.microsoft.com and created new project with dotnet new command in a folder.

Building C# project shows error:

The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0.

I checked it but it doesn't work in my case:

Visual Studio 2017 with .Net Core SDK 2.0

Visual Studio 2017 with .Net Core SDK 2.1

JPBlanc
  • 70,406
  • 17
  • 130
  • 175
Philipp
  • 521
  • 1
  • 4
  • 6
  • 2019 Preview 5 has an installer.. 2.1 appears to be the highest version that installs into 2017, although 2.2 tools are also available. – Joseph Poirier May 09 '19 at 00:09

10 Answers10

48

Unfortunately .NET Core 3 requires MSBuild 16. Even if you enable preview versions of .NET Core in VS 2017 as others have suggested you will still get the error:

The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0.

If you create a global.json file and put in eg.

{
  "sdk": {
    "version": "3.0.100-preview5-011568"
  }
}

You then get shown the real problem which is:

error : Version 3.0.100-preview5-011568 of the .NET Core SDK requires at least version 16.0.0 of MSBuild. The current available version of MSBuild is 15.9.21.664. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.`

MSBuild 16 only comes with VS 2019, so, the answer is that you CAN use VS 2017 with .NET Core 3, but only if you also have VS 2019 installed as well!

Dave Cousineau
  • 12,154
  • 8
  • 64
  • 80
user917170
  • 1,591
  • 15
  • 28
  • 4
    Can'y you just install MSBuild 16 separately? – Janne Harju Jul 30 '19 at 05:22
  • @JanneHarju I tried to install the Visual Studio Build Tools 2019 but it didn't seem to help, only the full Visual Studio 2019 did. Worth trying again though I had various other issues. – user917170 Aug 13 '19 at 11:35
  • @user917170 Does this means I have to buy Visual Studio 2019 now? Or is there some other way? Also do you think they will also make this available for 2017? – Morganis Dec 17 '19 at 11:08
  • 1
    @Morganis I didn't look into it any further so not sure if there is a workaround, but you could probably just install the free Visual Studio 2019 Community edition and not have to pay anything except bandwith and hard drive space, then keep using Visual Studio 2017. – user917170 Dec 19 '19 at 11:15
  • How do you target MSBuild 16? – Andrius Naruševičius Mar 31 '20 at 11:48
  • @AndriusNaruševičius Not sure what you mean, .NET Core 3 always targets MS build 16 – user917170 Mar 31 '20 at 22:06
  • @user917170 exactly. But VS2017 uses msbuild 15.x and I cannot find a way how to "tell" VS to use a different msbuild file. – Andrius Naruševičius Apr 01 '20 at 14:39
35

.In VS 2017: You can just go to the ToolsOptionsProject and Solutions.NET Core and then check Use previews of the .NET Core SDK

8

Visual Studio 2019 update

About the original answer from @GoDev :

Starting with Visual Studio 2019, the option has moved to:

Tools > Options > Environment > Preview Features

Option screen

Official notes

Treycos
  • 7,373
  • 3
  • 24
  • 47
4

.Net Core 3.0 requires Visual Studio 2019 Preview 1, you can't use Visual Studio 2017. According to the .Net Blog, "Visual Studio 2019 will be the release to support building .NET Core 3 applications" and requires .Net 4.8

When creating a new application/project, the project declares a dependency on .Net Core 3.0 via the netcorepp3.0 target framework.

Trevor
  • 7,777
  • 6
  • 31
  • 50
  • It is possible, it's just an unsupported scenario. From the blog you linked: *"It is currently possible to open .NET Core 3.0 projects in Visual Studio 2017 15.9, however, it is not a supported scenario (and you need to [enable previews](https://blogs.msdn.microsoft.com/dotnet/2018/11/13/net-core-tooling-update-for-visual-studio-2017-version-15-9/))."* – user247702 Dec 05 '18 at 22:52
  • True, but it stands, `it is not a supported scenario`, just because you can doesn't mean you should. Then the case where things start happening and you don't know why... Thanks for your input @Stijn! – Trevor Dec 05 '18 at 22:54
  • 1
    I do agree with "just because you can doesn't mean you should" :) better to just use the 2019 preview instead. – user247702 Dec 05 '18 at 22:57
4

Came across the same issue and this article helped to sort out

1. Check if .NET Core SDK 3.x is installed

enter image description here

If there is none, go to the official .NET Core 3 Download page and get it, then install it and try again. https://dotnet.microsoft.com/download/dotnet-core/3.0

2. Enable .NET Core SDKs Previews

enter image description here

.NET Core 3.0 preview1 was the last version of .NET Core 3.0 that worked with Visual Studio 15.9 (aka Visual Studio 2017): any subsequent release of .NET Core 3.0 (including nightlies) require VS 16.0+, aka Visual Studio 2019.

3. Check the PATH environment variables

enter image description here

Reference : https://www.ryadel.com/en/current-net-sdk-not-support-net-core-3-0-fix/

Community
  • 1
  • 1
CharithJ
  • 46,289
  • 20
  • 116
  • 131
3

To create or open applications targeting .NET Core 3.0, Visual Studio 2019 or newer is required. When creating a new project Visual Studio may show you a yellow bar with the message "ASP.NET Core 3.0 or newer projects are not supported by this version of Visual Studio"

more informaion: https://github.com/aspnet/Tooling/blob/master/dotnet-core-3.0-preview1.md

AminRostami
  • 2,585
  • 3
  • 29
  • 45
2

You need to enable "Use previews of the .NET Core SDK" from

Visual Studio's tools | Options | Project and Solutions | .NET Core


After this, you need to restart visual studio and you will be able to use ".NET Core 3" projects.

You can also follow youtube page for any further queries regarding ".NET Core 3".

Community
  • 1
  • 1
Manish Jain
  • 1,197
  • 1
  • 11
  • 32
0

This is fixed in latest vs preview. Install it following steps in here. https://learn.microsoft.com/en-us/visualstudio/mac/install-preview?view=vsmac-2019

Jeevan
  • 518
  • 3
  • 8
0

If you're here from the future and there's no specific reason to stay on 2017, upgrading to 2019 will fix this problem.

make punk
  • 11
  • 4
0

install .net core 2.0. visual studio 2017 for .net core works for version 2.0, 1.1 and 1.0

  • This is an old question and your post doesn't answer the question, which has already been flagged as solved. – Rubenisme Mar 28 '22 at 13:50
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 28 '22 at 13:52
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/31393983) – 777moneymaker Mar 30 '22 at 12:41