4

I have a Visual Studio Enterprise 2017 with version 15.9.7 and .Net core 2.2 and .Net SDK 2.2.1. I was trying to create a blazor web application following this link. In the article, it shows a template of type Blazor. But I do not get the same template in my visual studio.

On further investigation, I found this link but the prerequisites include Visual Studio 2019 Preview and SDK 3.0 preview. I do not want to jump to them immediately when the versions are still in preview.

So is there no way to get the template in my current configuration? Are there any kind of work around for this?

This is the exact same question but the solution marked does not work in my case.

EDIT 1: I tried installing blazor extension, but it says this extension is not installable on any currently installed products(in my case it is VS 2017).

EDIT 2 : I tried to create the project using CLI, but ended with the error

error NU1202: Package Microsoft.AspNetCore.Blazor.Cli 0.9.0-preview3-19154-02 is not compatible with netcoreapp2.2 (.NETCoreApp,Version=v2.2). Package Microsoft.AspNetCore.Blazor.Cli 0.9.0-preview3-19154-02 supports: netcoreapp3.0 (.NETCoreApp,Version=v3.0)

8
  • Make sure that you have the blazor extension installed, and if that doesn't work, I'm afraid you need to "bite the bullet" and use VS2019 and .Net Core 3.0. Both of which are very much usable with VS2019 being released April 2nd and .Net Core 3.0 later this year Commented Mar 27, 2019 at 13:21
  • @MindSwipe I tried installing that, but it says this extension is not installable on any currently installed products(in my case it is VS 2017). Commented Mar 27, 2019 at 13:25
  • From what I have read it is only available in VS2019 and .Net Core SDK 3.0, this is what i followed learn.microsoft.com/en-us/aspnet/core/client-side/spa/blazor/… Commented Mar 27, 2019 at 13:27
  • The Blazor extension is what actually makes you be able to create and run Blazor apps, without it you won't be able to use Blazor. So I guess you need to either use VS2019 or wait until Blazor isn't experimental anymore Commented Mar 27, 2019 at 13:27
  • @DavidYenglin I have seen examples like this msdn.microsoft.com/en-us/magazine/mt833288 which used .Net core 2.1. Has something changed from that to it's current state? Commented Mar 27, 2019 at 13:31

1 Answer 1

8

In order to use Blazor you will need to upgrade to Visual Studio 2019 and .NET Core 3 preview SDK.

Before VS 2019 all the tooling for building Blazor projects was included in the Blazor Extension for Visual Studio, along with the templates. However, the tooling is now built into VS 2019 directly. The Blazor Extension now only contains project templates.

The good news is that you can install VS 2019 along side any existing stable VS versions you have. The same goes for the preview SDKs of .NET Core.

Sign up to request clarification or add additional context in comments.

5 Comments

It's also worth mentioning that VS 2019 is very stable and mature already (rightfully so, as it releases in a few days) and that the .Net Core 3.0 preview is also quite stable. Also, if you're considering using Blazor (an experimental web framework) then you should have no problem using preview tooling to develop it
Might be a totally wrong understanding on my part, but say I have an existing 2017 ASP.Net Core application that I need to integrate with this blazor app, Is there any way I can achieve it?
Not without moving to Core 3 and VS 2019. Just to be clear you're using client-side (Blazor) not server-side (Razor Components)?
Currently I have a totally functioning .Net core application which uses JS for certain client side validation. I was thinking of a way to eliminate that by having a common server and client side code for those validations and that is where I am thinking to include Blazor.
Cool, just in case you're not aware Blazor is only experiential and could be dropped, although very unlikely. Have you looked at Razor Components (aka server-side Blazor). This is an official product in .NET Core 3. Apologies if I'm telling you things you already know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.