T4MVC failing to generate classes with ErrorGeneratingOutput
Asked Answered
P

1

10

My MVC project has used T4MVC for scaffolding working fine for years. I made a change to the parameter inputs for one of my controller methods and for some reason when I ran "Run Custom Tool" to pick up the changes, it instead over wrote the T4MVC.cs file with the text "ErrorGeneratingOutput".

I tried backing out the changes with no effect. I also cleaned and tried rebuilding the project multiple times but now there is just no classes under T4MVC.tt and it still fails the same way when trying to regenerate everything.

When I attempt to debug the template ("Debug T4 Template") it over writes T4MVC.cs file with "ErrorDebuggingTemplate" instead.

I also tried updating T4MVC to the latest version on nuget (3.17.4) but that didn't change the behavior at all.

Until this is fixed I can't push any changes as the project now reports thousands of errors (most missing assembly references) so would really appreciate any help getting this resolved. Thanks.

Plasm answered 5/7, 2016 at 15:29 Comment(0)
C
0

I was having a similar issue accompanied by build errors, such as "Invalid token 'this' in class, struct, or interface member declaration". Other devs on my team were not having the problem.

We were on version 4.2.1 so I upgraded to 4.2.4 and the problem went away. 4.2.4 ran and changed two action methods to be virtual (I'd forgotten to do that, so maybe that was causing the issue).

This is a little late, but maybe someone else can benefit from it.

Catlee answered 9/7, 2020 at 19:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.