t4 Questions
2
Solved
How can I get a reference to the directory of the visual studio project or solution or the directory of the t4 template from within a t4 template?
I have a template that concatenates a number of f...
Gorizia asked 29/8, 2009 at 22:43
4
I am writing a T4 script which reflects over certain classes and provides code generation based on them. The problem is that my script errors out, saying that the classes in my current project cann...
Climax asked 21/7, 2010 at 10:8
1
Solved
While using T4 classes for entity framework there are a couple of developers who generate classes with one extra new line for every line generated. I'm wondering if this is some kind of setting tha...
3
I have some T4 templates in my project. Whenever I make changes and save the tt file, it auto update the generated files. This is a template that loops all tables in a database and generates about ...
Cinchonine asked 27/11, 2012 at 23:7
2
We have a database project in Visual Studio 2013. In this project we have a .tt file which generates .sql script. The problem is after generation the build action of the generated file is automatic...
Aside asked 4/5, 2015 at 19:54
4
Solved
I'm looking for a tutorial, guidance or software that can generate simple POCO's for some SQL Server tables for use in ASP.NET MVC. Something like this:
1) Keep a list of the table names in ...
Suzette asked 27/10, 2011 at 16:15
4
Solved
I'm using Entity Framework 5 with Visual Studio with Entity Framework Power Tools Beta 2 to reverse engineer moderately sized databases (~100 tables).
Unfortunately, the navigation properties do n...
Pashalik asked 17/10, 2012 at 14:56
1
I have a .NET Core class library project and I want to use design-time T4 templates.
The tempalate compiles correctly, but when I try to use Reflection it raises an error
Running transformation:...
3
Solved
I have a custom dll, which has a class in it, and (for simplicity's sake) there's a method on it which'll return a string.
I have a project, which references said dll, and I want to use a (not pr...
Theiss asked 27/5, 2011 at 11:2
1
a T4 text template is a mixture of text blocks and control logic that can generate a text file.
T4 templating is not natively supported in .Net Core.
Can anyone suggest to me T4 alternative in .N...
3
Solved
is there a way I can read in a namespace and loop through all the classes in a t4 template using reflection or something?
<#foreach (class poco in LoadNamespace("Web.Code.Entities.Poco").Class...
Ence asked 13/10, 2010 at 14:35
2
Solved
In the process of writing a T4 text template I ran into an issue I'm struggling to get by. I need to know the type of the enum I'm processing.
I have enums that are based on byte and ushort. I nee...
3
I've been debugging an issue for a day now and can't seem to figure it out. Perhaps someone else has run into something similar and can shed some light?
We've configured all T4 templates within a ...
Jesus asked 20/8, 2013 at 16:34
2
Solved
I'm trying to run a T4 template that opens a XML file and uses it contents to generate a code artifact. However, I'm getting the an error message when I try to run a T4 template similar to the one ...
Gustatory asked 28/5, 2010 at 19:35
1
The question is: is there a way to have a setting in the *.tt file so that the generated files are set to a specified Build Action?
The thing is I am generating SQL script using a template. I use ...
Chatav asked 31/3, 2016 at 12:3
3
I have T4 template where I'd like to generate an .cs file.
I have an array of System.Data.DataColumn that i'd like to use as a private variables in my generated code file.
I'm using ColumnName a...
Briarroot asked 23/4, 2013 at 10:6
4
Solved
I'm using Typelite 9.5.0 to convert my C# classes to Typescript interfaces. I want that a nullable type in (e.g. Guid?) is converted to a nullable type in Typescript.
Currently I have this C# clas...
Treatise asked 26/9, 2014 at 6:37
1
Solved
I am big fan of shared projects and I want to use T4 templates similarly: reference shared project in different solutions and get access to generated content without hassle.
How to make T4 templat...
Fouquiertinville asked 26/4, 2016 at 7:17
2
I'm having a bit of trouble here - my T4 templates that should generate C# classes refuse to successfully run when I save or "Run Custom Tool". However - it's only when I "Debug T4 Template" that i...
6
Solved
I am doing some work with T4 (Text Template Transformation Toolkit) and am trying to get to a point where I can create my own custom text template host. However, all of that relies on the Microsoft...
Manysided asked 17/2, 2009 at 22:31
2
Solved
I am trying to get the If else statement to compute the value based off the object passed in from the loop. This template worked until i added in the if else block and it says it can't be used as a...
3
I'm having a lot of trouble trying to identify why MSBuild is blocking access to a dll used inside a new T4 template I just created.
The problem is kind of hard to explain (and even ask, as is evi...
2
How do I get T4 Template support in Visual Studio 2015?
In VS 2015 the file property does not allow to specify the *tt file to be marked and allow to run from context menu.
I am using VS 2015 CTP6....
Booster asked 2/3, 2015 at 5:40
2
Solved
I'm building a set of T4 templates that gather their data from an XML file. Is there any way to force Visual Studio to regenerate the templates when the XML file is changed?
Presently, the develop...
Pender asked 9/11, 2010 at 21:4
3
Solved
I am using T4 in Visual Studio 2010, and I want to iterate over the files in my solution, however I have found that T4 source generation works in a kind of a sandbox, and the current working direct...
Jessamine asked 10/2, 2011 at 2:37
© 2022 - 2024 — McMap. All rights reserved.