i am planning to use T4 template to generate the config files. i have a main.tt file with basic settings. there are different .tt file for each environment which include the main.tt one thing which i want to achieve is how do i make sure that each environment specific .tt files override the main.tt variables. i need to do this since i want to make sure that all the values are overwritten in environment specific .tt files else T4 template will pick up the main.tt values. I want to avoid any missing environment values to be picked from main.tt How do we specify a mandatory override from main.tt?
<#@ template language=“C#” #> <#@ output extension= “.config” #> ” providerName=”System.Data.SqlClient” /> ” providerName=”System.Data.SqlClient” /> <#+ string NorthwindConnectionString = “Data Source=.;Initial Catalog=Northwind;Integrated Security=True”; string PubsConnectionString = “Data Source=.;Initial Catalog=Pubs;Integrated Security=True”;
>
how do i make sure NorthwindConnectionString and PubsConnectionString have specific values in all environment specific .tt files?