title: T4 Template Generator rebuilt for Net Core
body: <p>I am working on a T4 template generator for Visual Studio that supports the net core runtime. The following requirements are</p>
  <ol>
  <li>T4 templates using netstandard 2.0 or netstandard 2.1 function assemblies.</li>
  <li>Support the latest language compiler.</li>
  <li>Debug T4 Templates in visual studio.</li>
  <li>generate T4 templates in visual studio via custom tool</li>
  </ol>
  <p>That being said, what VS 2019 provides out of the box:</p>
  <ol>
  <li>T4 Template engine running on the Framework runtime.</li>
  <li>Roslyn in process compiler is limited to C# 5.0.</li>
  <li>Visual studio uses remote services to execute the template generation in a T4 host process, to attach too and debug the template.</li>
  <li>netstandard 2.x function assemblies are not supported, at least I could never get them to work.</li>
  </ol>
  <p>Some of the considerations I have to account for are:</p>
  <ol>
  <li>netcore and net 5, do not support AppDomain.</li>
  <li>The T4 text transformation compiled with rosyln can not process in the framework, will not load the System.Private.CoreLib. this requires that a host process exist not only to generate the code files but also to debug them as well.</li>
  <li>This also means that the T4HostProcess uses named pipes to communicate with Visual Studio. Is the Host Process the named pipe server or is it the client. I want to say the server, but I am not sure, that is why I am posting this on stack overflow.</li>
  <li>With the last statement, I am pretty sure that I have to find a way to facilitate cross domain communication using named pipes, between a .net core process and a framework process(visual studio). Remote services is not an option because it was built for framework and will not work for .net core.</li>
  </ol>
  <p>Steps taken to arrive to a solution:</p>
  <ol>
  <li>using the Mono T4 template engine to compile the T4 Transform assembly, using the netcore runtime of Roslyn.</li>
  <li>I have been able to accomplish the following: custom tool, compile a T4 transformation assembly.</li>
  </ol>
  <p>I would love to hear about any suggestions on how I can get this working. I am in the weeds with this and some of them look downright daunting.</p>