T4 alternative in .NET Core?

NBM picture NBM · Sep 4, 2016 · Viewed 13.1k times · Source

a T4 text template is a mixture of text blocks and control logic that can generate a text file.

Can anyone suggest to me T4 alternative in .NET Core?
How can we do code generation?

Answer

OzieGamma picture OzieGamma · Sep 4, 2016

You could use Scripty. It looks quite nice and fits with the new Analyzers from Roslyn.

http://daveaglick.com/posts/announcing-scripty

https://github.com/daveaglick/Scripty

Since they are dropping the project.json format (https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/) you should be able to use Scripty from the .xproj or .csproj file.