The Custom tool 'RazorGenerator' has failed.

Jun 11, 2012 at 3:59 PM
Edited Jun 11, 2012 at 4:09 PM

using VisualStudio2010, SP1

Razor Generator 1.3.2 (is visible under Tools -> Extension Manager)

RazorGenerator.Mvc 1.4.0 (via nuget)

I added a test Mvc4 'Internet Application' project and have assigned the 'Custom Tool' for the Index.cshtml as RazorGenerator as per your tutorial: http://blog.davidebbo.com/2011/06/unit-test-your-mvc-views-using-razor.html

The issue is no .cs file is generated! When I manually run the tool by right clicking the view .cshtml and selecting 'Run Custom Tool' I get 

>The Custom tool 'RazorGenerator' has failed.

I looked at this previous discussion http://razorgenerator.codeplex.com/discussions/294714 and ran VS with the /log flag however nothing is added to the log file after the error is generated.

I've tried rebooting VS and the PC.

Please help me as I am at wits end.

Coordinator
Jun 19, 2012 at 4:12 PM

To eliminate some variables, can you try running this sample project? Does Run Custom Tool fail in the same way there?

Jun 20, 2012 at 7:52 AM
Edited Jun 20, 2012 at 7:56 AM

David, thanks for your reply, and apologies for calling you out on Twitter - you had responded to a post above mine that was barely coherent and I was feeling very unloved! :)

Initially I couldn't open the sample project, however I guessed its MVC3 and for some reason this wasn't installed (even tho I 'installed' it using the Web Platform installer it still didnt show up in add/remove programs nor were the project templates available in VS, ie it wasnt installed)

After manually installing mvc3 (standalone package) everything now works (your test project and mine)

Prior to this I had MVC2 and MVC4 installed and RazorGenerator did not work (error as above) in this configuration. I didnt think mvc3 was a prerequisite for RazorGenerator? 

 

Thanks again

Coordinator
Jun 20, 2012 at 4:41 PM

Yes, the generator is compiled against Mvc 3 and WebPages v1, so it would need them installed. We could consider distributing them inside the vsix, but chances are without Mvc \ Razor tooling installed, you aren't getting any intellisense in VS which is probably less than ideal.