Bug 12172 - Enhancement - T4 generation should be available as a custom build step
Summary: Enhancement - T4 generation should be available as a custom build step
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: T4 ()
Version: 4.0.4
Hardware: All All
: --- normal
Target Milestone: master
Assignee: Mikayla Hutchinson [MSFT]
Depends on:
Reported: 2013-05-08 18:16 UTC by Felix Collins
Modified: 2014-06-26 12:17 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Felix Collins 2013-05-08 18:16:56 UTC
We use T4 templates to generate source files for a resource helper class and for embedding html template files into a helper class. When we change the content we then have to modify the T4 template file and save it before the output file is regenerated. This is very annoying. If the build system can't detect the dependency chain of the template and automatically rebuild when needed, then at the very least there should be a build option available to regenerate the templates as a pre-build step every time.
Comment 1 Mikayla Hutchinson [MSFT] 2014-06-26 12:17:39 UTC
In order to be compatible with VS/MSBuild, this would have to be implemented as MSBuild targets+tasks and either installed in the system MSBuild extensions directory (which XS cannot do on Mac, since it has no installer) or provided as a NuGet package (which is outside the scope of XS).

The ideal solution would be that someone created MSBuild targets and tasks using the Mono.TextTemplating engine, and published them in a NuGet package on NuGet.org.

I've already published the engine itself: https://www.nuget.org/packages/Mono.TextTemplating/