bennor / AutoT4MVC

A zero-configuration Visual Studio 2012+ extension for automatically running T4MVC templates on build and when files are modified in paths that T4MVC cares about.
http://bennor.github.io/AutoT4MVC/
MIT License
24 stars 9 forks source link

Doesn't seem to be working for me #1

Closed JohnLivermore closed 11 years ago

JohnLivermore commented 11 years ago

Hi, I downloaded your extension, but it isn't recompiling my template files. Just to be sure I put in some text that would cause a syntax error in my generated files, but the code compiled just fine and inspecting the generated files show they haven't been regen'd with the breaking change. Any ideas or how to debug?

bennor commented 11 years ago

All the extension really does is wait for a build event from VS, then scan your projects for a files named "T4MVC.tt" which it re-runs by saving. I've just tested the situation you describe with a T4MVC template in one of my projects and it produced the expected errors.

So the first thing I would make sure is that the templates you're talking about are actually T4MVC templates and have the expected filenames. If you are trying to automatically compile other T4 templates, this extension won't do it as it is currently written, because it was intended to solve a very specific problem. It's pretty simple under the hood so it would be very straightforward for you to grab the source and make it do what you want. There's really no reason why it shouldn't regenerate all templates, other than maybe performance (if you have a lot of templates or some that do a lot of work).

If you do have T4MVC templates and it's not working with them, then I'd suggest the same thing - grab the source and open it up in VS. When you run it in debug mode it will spawn a child VS that you can open your project in to step though the code and find the bug. If you manage to find and fix a bug I would love a pull request.