Can I Enable and Redo RazorGenerator as a pre-build step?

Dec 5, 2012 at 3:26 AM

This may have a cost of increasing build time, at the same time, at least "Enable" feature can be very handy in case people miss the setting, etc.

 

Also, would it be possible to run these commands from a batch/Powershell file outside VS Nuget command prompt? Of course assuming we pass the specifics of the project.

 

Thanks a lot.

Coordinator
Dec 5, 2012 at 4:09 PM

This is already something like that. See Using RazorGenerator.MsBuild.

Dec 5, 2012 at 9:14 PM
Edited Dec 5, 2012 at 9:15 PM

Thanks a lot David, and sorry for missing that.

Another question if you may, if I use the MSBuild version, and do xcopy deployment of the web application project (or run locally) without deleting view files (.cshtml), these file will take priority over the compiled classes, right? (and, in essence, will be compiled again by IIS?)

Coordinator
Dec 5, 2012 at 9:38 PM

That depends on settings. Look for UsePhysicalViewsIfNewer in in your App_Start\RazorGeneratorMvcStart.cs and it'll make sense :)