Visual Studio 2017 Blazor Project Templates Missin

2019-08-26 07:33发布

问题:

I'm exploring building a Blazor SPA app for a test project I'm working on using Visual Studio 2017 (15.9.4). I have installed .NET Core 2.2.1 and the Blazor Language Services extension but when I open Visual Studio to create a new project, no Blazor template is shown. I was able to create a project using the CLI but when I open the project in Visual Studio it gives several errors inside even though the project runs. There are also no Blazor page templates available when I try to New Item. What can I do to get the templates to load in Visual Studio?

回答1:

This may occur as a result of upgrading from older version of VS and .Net Core

Try one of the two: 1. In global.json file, change the .Net Core version to 2.2.100 like this:

{
  "sdk": {
    "version": "2.2.100"
  }
}

2. If it still does not solve your problem delete it altogether.

Hope this helps...



回答2:

Okay, so I figured it out. I went to File >> New >> Project, selected "ASP.Net Core Web Application" then on the next window I had to change "ASP.NET Core 2.2" to "ASP.NET Core 2.1", then the templates were there.