Bug 8026 - T4 template regenerated only on every other content change
Summary: T4 template regenerated only on every other content change
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: T4 ()
Version: 3.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Mikayla Hutchinson [MSFT]
Depends on:
Reported: 2012-10-26 14:07 UTC by Len Charest
Modified: 2014-06-26 18:48 UTC (History)
3 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 Len Charest 2012-10-26 14:07:41 UTC
Add a T4 template named Test.tt to an existing C3 project. Generated file Test.cs will exist and contain some whitespace. Paste the following into the template:

<#@ template language="C#v3.5" #>
<#= DateTime.Now.ToString("F") #>

Save the template. The contents of Test.cs will NOT be updated. 

Now type any character on line 3 of Test.tt and save. The contents of Test.cs will be updated.

Repeat the process of making a change to Text.tt and saving. You will observe that the generated file is updated on every other content change.
Comment 1 Mikayla Hutchinson [MSFT] 2014-06-26 18:48:44 UTC
Fixed in https://github.com/mono/monodevelop/commit/ffe059c35e880dee32d2b878ec22f28cc92b22d9

Not that the generated file *was* getting updated, but the source editor was not reloading it.