Custom tool error: Could not load generator "MvcView".

Jun 11, 2011 at 3:41 PM

I'm using the Razor Single File Generator VS extension to pre-compile my views into my class library. At least I'm trying to. I've followed the instructions and when I run the custom tool, I get this error:

Custom tool error: Could not load generator "MvcView".

I've downloaded the source code for the extension and the sample projects within exhibit the same behavior. I've uninstalled and re-installed the extension, no luck. I restarted VS (all instances) after install/uninstall, too.

Here's the view:

@* Generator: MvcView *@

@model MyModel

    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/DefaultLayout.cshtml";


Jun 11, 2011 at 4:38 PM

The version on the gallery was the older one that didn't support this. I just uploaded build 0.6 that adds the MvcView support. Could you give it a try? VS should automatically find that there is an update for that extension.

Jun 11, 2011 at 11:08 PM

Yep, it works. Thank you. Now, is there any way to override the modifier on the generated class? My models are internal and the generated view is public, so that doesn't work too well. I'll probably just have to change the models to be public.

Jun 12, 2011 at 6:44 AM

Wouldn't your model classes need to be public anyway if you used a standard (non-precompiled) MVC view?

Jun 12, 2011 at 6:48 PM

That's one reason why I'm pre-compiling the views. I don't generally like exposing classes that need not be exposed, that's all. For this project it doesn't matter much so I just made the models public and am moving on. Thanks for your help!

Jun 13, 2011 at 1:27 AM

You may want to file an issue just to track this. But I don't know if we can make it internal by default, as that might break some scenarios (or not, I'm actually not sure).

Jun 13, 2011 at 3:25 PM

Okay, I will. No I don't think it should be internal by default but if it was configurable some how, that would be good. I'll add a feature request. Thanks.