Visual Studio 2017 Blazor Project Templates Missing

时间:2019-01-18 18:52:17

标签: visual-studio templates blazor

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?

Visual Studio New Project

Errors with new Project

2 个答案:

答案 0 :(得分:0)

这可能是由于从较早版本的VS和.Net Core升级而发生的

尝试以下两种方法之一: 1.在global.json文件中,将.Net Core版本更改为2.2.100,如下所示:

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

2。如果仍然无法解决问题,则将其完全删除。

希望这对您有帮助...

答案 1 :(得分:0)

好的,所以我知道了。我转到文件>>新建>>项目,选择“ ASP.Net Core Web应用程序”,然后在下一个窗口中,我必须将“ ASP.NET Core 2.2”更改为“ ASP.NET Core 2.1”,然后在那里有了模板

enter image description here

Showing Template