razorgenerator changes generator based on file name *helper*.cshtml

Jun 4, 2014 at 7:31 PM
If a razor file is named ...helper...cshtml then the .cshtml.cs file that is created is very different.
This seems to be because the file name changes the default generator, from MvcView to MvcHelper

Is there a command-line way to override this?

I'm using RazorGenerator.MsBuild.
Jun 4, 2014 at 7:37 PM
Try adding this at the top of the file to override:
@* Generator : MvcView *@
Jun 4, 2014 at 7:59 PM
I'm supporting a large programming team, and this might come up again.
Is there any way to control this from msbuild ?
If 'not yet', would you be open to me submitting a code change?
Jun 4, 2014 at 8:25 PM
Edited Jun 4, 2014 at 8:30 PM
You could add a file named razorgenerator.directives to the root of the project \ root of the views directory with the following content:
Generator: MvcView
and it'll ensure all cshtml files are generated as Views