13

I'm getting "; expected" error in my .razor file and in _razor.g.cs file,

In previous blazor versions I was finding these g.cs files in the solution folder, now I can't find them there, and double clicking on the error message in VS doesn't point me to anywhere (error message has no line number, the one for .g.cs has a line number), and I can't find the problem.

Where are the _razor.g.cs files located now ?

buga
  • 852
  • 9
  • 21
  • 1
    the error was a missing `;` after `return `, for some reason VS has trouble showing me this line – buga Feb 18 '22 at 19:41

1 Answers1

30

Edit the project file (.csproj) and add this:

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

The file will by default go to obj\debug\net6.0\generated\...

H H
  • 263,252
  • 30
  • 330
  • 514