Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?

like image 490
buga Avatar asked Nov 27 '25 23:11

buga


1 Answers

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\...
Click the "Show all files" button to find it.

like image 135
Henk Holterman Avatar answered Dec 01 '25 04:12

Henk Holterman