为什么Visual Studio在.cshtml中为编译良好的新Blazor项目显示9个错误?如何禁用它?

时间:2018-12-29 15:00:03

标签: c# visual-studio blazor visual-studio-2019

我刚刚通过创建了一个新的blazor项目

  

dotnet全新blazorhosted

并打开FetchData.cshtml,但是VS向我抛出了9个错误。

当然整个项目都可以编译并且可以正常工作,但是很烦人

如何禁用.cshtml文件的显示错误?

Visual Studio 2019预览版

Severity    Code    Description Project File    Line    Suppression State
Error   CS0103  The name 'forecasts' does not exist in the current context  Blazor.Client   FetchData.cshtml    27  Active

Error   CS0115  'Template.ExecuteAsync()': no suitable method found to override Blazor.Client   FetchData.cshtml    1   Active

Error   CS0229  Ambiguity between 'Template.__o' and 'Template.__o' Blazor.Client   FetchData.cshtml    1   Active

Error   CS0229  Ambiguity between 'Template.__o' and 'Template.__o' Blazor.Client   FetchData.cshtml    1   Active

Error   CS0229  Ambiguity between 'Template.__o' and 'Template.__o' Blazor.Client   FetchData.cshtml    1   Active

Error   CS0103  The name 'page' does not exist in the current context   Blazor.Client   FetchData.cshtml    4   Active

Error   CS0103  The name 'inject' does not exist in the current context Blazor.Client   FetchData.cshtml    5   Active

Error   CS0103  The name 'forecasts' does not exist in the current context  Blazor.Client   FetchData.cshtml    11  Active

Error   CS0103  The name 'functions' does not exist in the current context  Blazor.Client   FetchData.cshtml    37  Active

0 个答案:

没有答案