Can't get t4 "run on build" to work

Feb 24, 2012 at 9:53 AM
Edited Feb 24, 2012 at 1:06 PM

The T4 template 'Run on build' feature would be great for us but I can't get it to work.

I have checked the 'Run on Build' checkbox in the Chirpy options Dialog, but when I build my project in VS the files are not generated.

Do I have to enter anything in the  'Template:' text box?

Feb 26, 2012 at 7:26 PM

Do I have to enter anything in the  'Template:' text box?

Enter your t4 template file.

Sample :,

Feb 27, 2012 at 8:52 AM
Edited Feb 27, 2012 at 12:29 PM

I now found out that I need to enter either the absolute path of the tt file or the relative path from the solution folder (my tt file is in a sub-folder of the solution folder). If Chirpy does not find the tt file there is no warning or error message.

But I still have a problem, I get a 'System.UnauthorizedAccessException' error when I build. e.g. Access to the path 'C:\Code\search\' is denied.

This is because the tt file is not checked out and it is read-only. We are using TFS.

This makes it unusable for our requirements - we don't want to check out the tt file. The tt file does not change often, but the source model that the tt file uses to generate code changes regularly.