在 razor.g.cs 文件中出错,在 VS 中找不到,找不到 _razor.g.cs 文件

error the in razor.g.cs file, can't find in VS, can't find the _razor.g.cs file

我的 .razor 文件和 _razor.g.cs 文件中出现“;预期”错误,

在以前的 blazor 版本中,我在解决方案文件夹中找到这些 g.cs 文件,现在我在那里找不到它们,双击 VS 中的错误消息并没有指向任何地方(错误消息没有行号,.g.cs 的错误消息有行号),我找不到问题所在。

_razor.g.cs 文件现在在哪里?

编辑项目文件 (.csproj) 并添加:

<PropertyGroup>
    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>   
</PropertyGroup>

文件将默认转到 obj\debug\net6.0\generated\...