Default the Custom Tool and Auto-Determine Namespace

Jun 14, 2011 at 2:30 AM

Is there any way to have all views automatically use the RazorGenerator custom tool and determine the namespace to use based on the folder hierarchy and root namespace of the containing project? Maybe I could just target BeforeBuild to do this, actually.

Along the same lines, is there any way to override the class names the generator uses? E.g. instead of "_Pages_X_Y_Z_MyView", just have it be "MyView".

Coordinator
Jun 15, 2011 at 1:14 AM
Edited Jun 15, 2011 at 1:16 AM

Doesn't the generator generate namespaces based on directory structure + RootNameSpace? Yes, we are going to fix the View names to be just the file name. Ebbo's going to file a bug for it.

Coordinator
Jun 15, 2011 at 1:14 AM

http://razorgenerator.codeplex.com/workitem/4

Coordinator
Jun 15, 2011 at 1:16 AM

As for the first scenario, I think it makes sense to modify the proj file to do this. Perhaps a powershell script via the NuGet console to set them up in batch.

Jun 15, 2011 at 7:42 PM

My mistake, yes it does the namespace correctly. Thanks for logging the bug about the class name.