Visual Studio 2017 Blazor Project Templates Missing

六月ゝ 毕业季﹏ 提交于 2020-01-06 06:43:22

问题


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.



来源:https://stackoverflow.com/questions/54259887/visual-studio-2017-blazor-project-templates-missing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!