Is it possible to write MyGeneration Templates in F# and how?

Someone asked on Stack Overflow:

I want to write a MyGeneration Template File in F#. I know you can target various languages etc VB.NET and C# however for my own selfish benefit I would like to write it in F#.

Anyone one if and how this is possible?

I posted the following answer, which was chosen as the accepted answer and received 1 upvote:

In visual studio you can use T4 templating to generate any type of output using a psudo “asp classic” style syntax, where you intermix your code (F#) and the “output.”

Heres a good place to get started: http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx


Originally posted on Stack Overflow — 1 upvotes (accepted answer). Licensed under CC BY-SA.

signed letter b

Dad. Geek. Gamer. Software developer. Cloud user. Old Car enthusiast.  Blogger.


Top Posts


profile for Nate on Stack Exchange, a network of free, community-driven Q&A sites
a proud member of the blue team of 512KB club
Thoughts, opinions, and ideas shared here are my own. © 2026 Nate Bross.