I'm trying to run a new T4 template in Visual Studio 2015. However it fails to compile at this line:
var message = $"Linked table '{linkedTable}' does not exist.";
The compiler reports that the '$' character is unexpected. This syntax should however be valid in C# v6, according to the new string interpolation feature guidelines.
Is there a way to make the T4 templating engine use the newer C# version, other than to compile my code in an external library?
UPDATE:
Here are the declaration elements for the file, as a reference:
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ output extension=".sql" #>
<#@ SqlModelDirective processor="SqlModelDirectiveProcessor" #>
<#@ import namespace="System" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="Microsoft.SqlServer.Dac" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="Microsoft.SqlServer.Dac.Model" #>
Apart from the SqlModelDirective
element this is pretty standard I think.