Are there any alternatives to T4 templates and EnvDTE for cross platform asp.net 5 development?

asp.net-core code-generation entity-framework-core t4

Question

We currently use T4 templates to generate C# code files based on C# Code (Entity POCO's) and the EDMX (in older applications)

Moving to ASP.NET 5 with a view to support cross platform development, are there any code generation tools available that can read a projects class & meta data structures, and to generate C# files at design time, similar to T4 templates?

1
10
1/3/2016 3:27:20 PM

Accepted Answer

Even tt templates weren't supported earlier in asp.net-5 projects. It has been added recently (in Visual Studio 2015 Update 1).

The discussion is here: https://github.com/aspnet/Home/issues/272

And in the thread, Eilon said the Roslyn is the way to analyse the code and generate new ones... And he again said the ASP team has no immediate plan. So currently we have no solution from Microsoft.

But I did some search and didn't find any cross platform community tool to generate codes based on other codes. :(

3
1/5/2016 11:55:26 PM

Popular Answer

You can try Scripty - it is Roslyn based scripting.

  • Syntax highlighting for *.csx files works out of the box;
  • VS extension exists to process scripts on save;
  • MSBuild task exists to process scripts during buld process;
  • Script allows you to traverse a hierarchical model of the project;
  • Multiple files generation from single script is supported;


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow