I'm getting the following error when building the project:
System.InvalidCastException: Cannot convert 'Microsoft.VisualStudio.TextTemplating.CommandLine.CommandLineHost' into 'System.IServiceProvider'
When running .tt inside Visual Studio, it works, but when building the project it throws that error.
<#
var serviceProvider = (IServiceProvider)this.Host;
#>
Basically, you wouldn't be able to resolve it because TransformOnBuild uses command line host which is not the one VisualStudio uses and console host doesn't work as a service provider
I'm getting the following error when building the project: System.InvalidCastException: Cannot convert 'Microsoft.VisualStudio.TextTemplating.CommandLine.CommandLineHost' into 'System.IServiceProvider'
When running .tt inside Visual Studio, it works, but when building the project it throws that error.
Any insights on how to resolve this?