Razor Generator – Generated class name is different than file name

I’ve been using Razor Templates to generate text blobs. For some reason, my razor templates stopped generating namespaces based on the file path and added underscores into the class name. I did the following to fix this issue.

Add this to the top of the cshtml file:

GeneratePrettyNames: true
GenerateAbsolutePathLinePragmas: true

So the top of the file might look similar to this declaration:

@* Generator : Template TypeVisibility : Internal GeneratePrettyNames: true
    GenerateAbsolutePathLinePragmas: true *@

Reference:  Codeplex Link