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.