86

I want to test the new Blazor server-side framework (aka Razor Components).

I installed Visual Studio 2019 RC, and then the .Net Core 3.0 preview 2, following this official tutorial.

After the install, I only see the ASP.NET Core 2.0 and the 2.1 on the "Create a new ASP.NET Core Web Application" page. The 3.0 is not showing up.

I started to mess around, trying to install other packages from this page, uninstalled and reinstalled Visual Studio 2019, updated to the .NET Core Preview 3, installed several times the x64 and x86 packages in different orders, copy/paste the .Net Core binaries to random folders and so on. Nothing works. The ASP.NET Core 3.0 does not show up.

Here is what my VS looks like when creating a project (the yellow message appeared latter after some messing around with the packages, so it is not the real problem):

enter image description here

Here is the output of the dotnet --list-sdks command:

enter image description here

EDIT

For some reason, I installed the Blazor VSIX package (the WebAssembly - not exactly what I want, but I installed it anyways) and now the ASP.NET Core 3.0 simply shows up. However, just for the blazor templates:

enter image description here

I don't understand. Is there anything obvious I'm missing?

Guilherme
  • 5,143
  • 5
  • 39
  • 60
  • 2
    I’ve installed the VS2019 Preview and it shows up fine.. I’m clueless as to what you’ve done differently?! – Robert Perry Mar 06 '19 at 22:15
  • Isn't changing targeting version in project file should be enough? – Fabio Mar 06 '19 at 22:45
  • @Fabio Good bet, but I don't think this would work, since the Razor Components project template is necessary to do what I want. AFAIK, the template only shows up when the .NET Core 3 is selected. – Guilherme Mar 06 '19 at 22:50
  • This problem exists with "dotnet-sdk-3.0.100-preview9-014004-win-x64". On removing preview9 and installing "dotnet-sdk-3.0.100-preview7-012821-win-x64", it worked! Hope this helps! – Abhi Sep 06 '19 at 09:09
  • 1
    @Abhi Nope. This is not with "dotnet-sdk-3.0.100-preview9-014004-win-x64". This is about VS 2019 update, which updates the packages for .NET Core 3.0 and then it will show up. – Harshal Yelpale Dec 24 '19 at 11:06
  • update VS will fix – Nikhil K S Nov 19 '20 at 09:31
  • Related post - [Visual Studio 2019 Not Showing .NET 5 Framework](https://stackoverflow.com/q/65724880/465053) – RBT Aug 12 '21 at 07:24

18 Answers18

134

There is an option in Tools -> Options that enables preview versions of the .NET Core SDK. In the VS Preview shipping channel, it is on (by default, and not settable). In the VS Release channel, it defaults to off and you can opt-in.

"Use Previews of the .NET Core SDK" in the Tools->Options dialog

(Note: it's disabled in the screenshot because I have a Preview build installed.)

The reason for this is to allow you to customize whether a project using a released version of .NET Core (such as 2.1, the current LTS) will use tooling from the newer not-yet-release-quality SDK.

Prior to 16.1, this option was located on the Tools -> Options -> Projects and Solutions -> .NET Core page.

Jimmy
  • 27,142
  • 5
  • 87
  • 100
  • 2
    Thanks for this. The .Net Core 3.0 Preview 3 release notes also confirm the same thing (under the Get Started section): https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-core-3-0-preview-3/ – Laurence Frost Mar 06 '19 at 23:51
  • 1
    Yes, thank you. I was loosing my mind over this. I know that I was missing something obvious. As @LaurenceFrost said, the linked post truly mentions it, but it is for `release` builds. So, it seems that Release Candidate builds are release builds. – Guilherme Mar 07 '19 at 01:15
  • 4
    Don't forgot to restart VS after setting 'Use Previews..' – CrusherJoe Mar 21 '19 at 19:15
  • 3
    The preview has been relocated, it's under Environment > Preview Features – Zulander May 22 '19 at 20:59
  • It seems like sometimes this needs a system reset, as when I tried this simply resetting VS didn't do the trick. – Remy May 23 '19 at 10:22
  • 10
    Done this, rebooted, still nothing, latest VS 2019 as of 2019-06-04. – jjxtra Jun 04 '19 at 23:37
  • I had to install both x64 and x86 SDK for .NET core 3 preview before it showed up... weird. – jjxtra Jun 04 '19 at 23:50
  • You will have to re-check this option with EACH AND EVERY minor Visual Studio 2019 update. – Brain2000 Aug 27 '19 at 18:51
  • Worked in my case. Thank you. – Sgryt Mar 29 '20 at 02:21
  • .net 5 preview requires same steps described in this answer. – Lukasz Szczygielek Jul 12 '20 at 02:30
56

Here is what I did to show .NET Core 3.0 in VS2019

  1. Installed .NET Core 3.0 SDK (No Success)
  2. Restarted VS2019 after installing .NET Core 3.0 SDK (No Success)
  3. Updated VS2019 (Worked Perfectly)
Usman Farooq
  • 938
  • 8
  • 10
  • 8
    Same. I installed all those .net core installers (x64, x86) but nothing worked. Then I realized I was stuck in Visual Studio 2019 16.2 (which did NOT have .net core 3). Once I updated to Visual Studio 16.3.5 .net core 3 finally showed up. That was painful. – Christopher Oct 17 '19 at 13:12
  • 3
    This should be the new accepted answer!! I tested this both VS 2019 Enterprise and Pro. Worked like a charm. Thank you!!! – Mike Nov 01 '19 at 17:44
  • 2
    I've updated 16.2.3 to 16.3.9 and finally seeing this ! thanks so much – Dev Nov 13 '19 at 22:38
  • 2
    Same here. This is the correct answer. I just updated the VS 2019 with the latest available update and it worked!! – Harshal Yelpale Dec 24 '19 at 11:01
  • Unless and until we have 16.1.3 + visual studio 2019 version, .net core 3.0 + (preview) versions will not be available for development in VS 2019 – Pallavi Kulkarni - Dhepe Jan 09 '20 at 05:59
  • I'm using VS 2019 Enterprise and it's version is `16.1.3`, which surprised me because I know that Community's version is `16.4.something` iirc. I checked for updates and was told that this is the current version, so I can't / couldn't just "update Visual Studio" unfortunately. (And still don't get the `3.1 (LTS)` version that I SHOULD be seeing.) :( – Scott Fraley Jan 15 '20 at 17:57
  • i solved for .net core 3.1. in macos with https://stackoverflow.com/questions/53030531/dotnet-command-not-found-in-mac?answertab=trending#tab-top – Furkan Doğanay Jun 27 '22 at 09:00
13

I had the same issue. Here is what worked for me.

  • First, download the latest .Net Core 3.0 SDK (see 1,2 below).

enter image description here

  • Next, Check for updates (4,5). (this is what helped me the most)

enter image description here

  • Next, Enable Preview SDK (5,6,7,8,9) and restart

enter image description here

  • Now, the .net core 3.0 option should show (11).
SunsetQuest
  • 8,041
  • 2
  • 47
  • 42
12

It no longer works... again!

The SDK 3.0.100-preview8-013656 doesn't provide the ASP.Net Core 3.0 project template.

You have to uninstall it and install SDK 3.0.100-preview7-012821

https://dotnet.microsoft.com/download/dotnet-core/3.0

Aage
  • 5,932
  • 2
  • 32
  • 57
Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
  • 1
    this helped for me! Thank you! – Kiril1512 Sep 03 '19 at 16:21
  • 4
    Same problem continues to exist with dotnet-sdk-3.0.100-preview9-014004-win-x64 that I tried with. On installing dotnet-sdk-3.0.100-preview7-012821-win-x64, it worked! Hope this helps! – Abhi Sep 06 '19 at 09:08
  • 1
    .NET Core 3.0 is supported with Visual Studio 2019 16.3 Preview 3 and Visual Studio for Mac 8.3, which were also released today. Please upgrade to it for the best (and supported) experience with .NET Core 3.0 Preview 9. – Marcus Wong Sep 11 '19 at 09:51
  • This helped, thank you! I have VS Professional 2019 installed and did not work with sdk and runtime preview9. Installed preview7 and worked. – Vergil C. Sep 12 '19 at 13:33
  • 4
    this This helped but the thing I do not understand why Creators of VS2019 let developers Suffer for hours. – Maytham Fahmi Sep 13 '19 at 10:29
7

I have the same issue here after moving from Visual Studio 2019 Preview to Visual Studio 2019 RC.

This page seems to suggest that you need Preview to use .net Core 3.0 which is annoying.

https://dotnet.microsoft.com/download/dotnet-core/3.0

I looked up the difference between RC and Preview, and they pull builds from different channels (stable and preview).

The next thing I’m going to try is to go back to Preview to see if .Net Core 3.0 becomes visible again.

Laurence Frost
  • 2,759
  • 3
  • 28
  • 45
  • According to [this post](https://devblogs.microsoft.com/visualstudio/visual-studio-2019-release-candidate-rc-now-available/), `both channels contain the same bits`. As I see it, they currently hold the same binaries, but maybe I'm wrong. – Guilherme Mar 06 '19 at 23:04
6

Tried to get .NET Core 3 (preview 8 in my case) to work in the release version of Visual Studio 2019 but ASP.NET Core 3.0 refused to show up in the "Create new ASP.NET Core web application" dialog.

What eventually worked was to install the Preview version of Visual Studio 2019.

I could have saved a few hours and a lot of hair if I had taken the warning text ".NET Core 3.0 should be used with the latest previews of Visual Studio." (https://dotnet.microsoft.com/download/dotnet-core/3.0) more literally...

Frazze
  • 251
  • 3
  • 4
4

In my case is because I did not installed Visual Studio 2019 with that feature. So just create a new project and type .net core. Then click on Install more tools and features:

enter image description here

Then add the following feature:

enter image description here

Tono Nam
  • 34,064
  • 78
  • 298
  • 470
1

I had this problem and solved it as follows:

STEP 1: Download .NET Core 3.0

STEP2: Enable the ability to consume preview SDKs by default, As shown below:

enter image description here

enter image description here

enter image description here

BehrouzMoslem
  • 9,053
  • 3
  • 27
  • 34
1

I had the very same issue. I tried everything with no success

I already had only x64 version of .NET Core SDK

In addition i had to install x86 version too. That WORKED !!!

Sankara
  • 1,469
  • 15
  • 22
1

If your solution uses global.json and sdk:version isn't compatible with the target framework, it won't let you select it or it disappears from Target framework drop-down in your project's properties. You will need to update it to something like this:

{
  "sdk": {
    "version": "3.1.0",
    "rollForward": "latestMinor"
  }
}
Pang
  • 9,564
  • 146
  • 81
  • 122
Paul Totzke
  • 1,470
  • 17
  • 33
1

I resolved it by installing

dotnet-sdk-3.1.403-win-x86.exe dotnet-sdk-3.1.403-win-x64.exe Because the visual studio was taking the SDK from "C:\Program Files (x86)\dotnet\sdk" once you install "dotnet-sdk-3.1.403-win-x86.exe" there will one folder under the above directory. then no need to restart your PC.

https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral

user3069438
  • 421
  • 4
  • 2
1

ASP.Net Core 3.0+ just runs on vs2019 version 16.7+. You need to go to help tab on your visual studio and check for updates and update it to the latest version

0

Note! (don't use it on your developer machine)

0- make sure you installed .net core 3 sdk. dotnet --list-sdks

1- make sure Tools -> Options that enables preview versions of the .NET Core SDK enabled.

2- uninstall all x86 version of .net core sdk from your machine.

3- restart visual studio and try to create a new project.

enter image description here

Navid Golforoushan
  • 728
  • 1
  • 9
  • 16
0

I was not able to get .netcore 3.0 preview8 working on my Visual Studio Community Edition (version 16.2.3). I opted to uninstall .netcore 3.0 preview8 and I installed .netcore 3.0 preview7 instead. After insalling .netcore 3.0 preview7 In Visual Studio I checked use previews of the .NET Core SDK option that is in Tools -> Options -> Preview Features and I restarted it. That worked for me, but if someone have .netcore 3.0 preview8 already working, help will be appreciated it.

  • .NET Core 3.0 is supported with Visual Studio 2019 16.3 Preview 3 and Visual Studio for Mac 8.3, which were also released today. Please upgrade to it for the best (and supported) experience with .NET Core 3.0 Preview 9. – Marcus Wong Sep 11 '19 at 09:51
0

I've encountered the same problem on a Mac and found a solution to this issue. On visual studio update tab (Visual Studio -> check for updates) there is a option to change channel to "Preview". Switch to Preview

After that you can download necessary updates and go using .net core 3.0

now there is option to change SDK to 3.0

Edgaras
  • 154
  • 9
0

I noticed an interesting behavior. I had the latest version of VS with all the dependencies installed. But when I try to add a new project to the solution, the dialog does not show me the options beyond .Net Core 2.2

enter image description here

But When I create the new project from the startup page, the drop down does show the ASP.NET Core 3.1

So I was able to work around the issue by creating the new project from the startup page, then add the existing project to the solution.

enter image description here

zafar
  • 1,965
  • 1
  • 15
  • 14
0

I've had the same issue after installing .net core 3.1. This is how I resolved it.

  1. open powershell, type dotnet --version, it returns '2.2.300'
  2. go to 'programs and features', unistall .net core sdk 2.2.3.0
  3. run dotnet --version again, it returns '3.1.302' and in VS 2019 it shows '.net 3.1'
Dharman
  • 30,962
  • 25
  • 85
  • 135
Langy
  • 315
  • 2
  • 6
0

This answer is for the newest .NET Core version as of 10/11/2020, which is .NET Core 5.0

Specs: VS Version 16.8.0

Target Version of .Net Core: 5.0

You must have version 16.8.0 in order to have .Net Core 5.0

If you still have problems with Visual Studio not showing .Net Core 5.0 in Visual Studio version 16.8.0 (and assuming you downloaded the .NET Core 5.0 SDK for Visual Studio), well, apparently (and correct me if I'm wrong) it is now called just .Net 5.0, omitting the Core.

enter image description here

After selecting .NET 5.0, I was able to install other libraries which are currently version 5.0+ and dependent on .NET Core 5.0+

Is the new name intentional? Anyways, here some evidence of this working (I was able to install the newest version of Newtonsoft and Entity Framework for .Net Core):

enter image description here

Funny enough, when I try to create a new .Net Core project, the version shows up as expected:

enter image description here

I'm very sorry for my English!

[PS: I'm literally copying&pasting this answer, which I answered somewhere else, but given that, when you Google this issue, this stackoverflow question appears first. So thats why I'm reposting]

LuisDev99
  • 1,697
  • 17
  • 13