This project is read-only.

Default the Custom Tool and Auto-Determine Namespace

Jun 14, 2011 at 3: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".

Jun 15, 2011 at 2:14 AM
Edited Jun 15, 2011 at 2: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.

Jun 15, 2011 at 2:14 AM

Jun 15, 2011 at 2: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 8:42 PM

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