t4 Questions

10

Solved

Wondering if anyone knows of a set of T4 templates for generating C# POCO classes and also mapping XML files for NHibernate from a set of tables in a database. I saw that David Hayden has created T...
Sinistrous asked 3/2, 2009 at 17:21

2

Solved

How can I instruct a T4 template to generate the resulting file with a given file name? I'll try to be more clear. Let's say I have a template called Insert.tt that generates code to insert a reco...
t4
Emmerie asked 30/1, 2013 at 15:20

2

Solved

I would like some help adding in a POCO .tt Entity Framework template Attributes to support WCF serialization and if its possible how to add namespace usings to each entity. Thank you.
Kristelkristen asked 9/9, 2010 at 15:39

2

Instead of this .tt: <#@ template debug="false" hostspecific="true" language="C#" #> <#@ import namespace="System.IO" #> <#@ output extension=".txt" #> <#@ assembly name="Syst...
Incident asked 9/1, 2011 at 17:37

4

Solved

I'm trying to debug the execution of a T4 template in Visual Studio 2008. All the information I'm finding on debugging T4 templates in Visual Studio 2008 say that you can set a breakpoint (red dot...
Sidecar asked 23/3, 2010 at 15:31

2

I have a class library project for a data access layer that uses Entity Framework 4. My project needs a versioning concept. My database contains many tables that contain «Id» and «CreationDateTime»...
Intellectualize asked 21/9, 2011 at 20:45

1

Solved

Database First (and Model First) approach has this nice DbContext Generator scaffolding files to generate the context and models; Model.Context.tt + Model.tt Since they have built-in helper method...
Fluidics asked 28/4, 2014 at 17:8

2

This is my first question on StackOverflow so Hi :) Is it possible to load assembly by Assembly name using Assembly.Load() in t4 template? I would like to use it to get all types with ServiceCont...
Tarpan asked 17/8, 2012 at 7:26

2

Solved

I want to use t4 to generate some text at runtime. I created a 'Runtime Text Template'. I noticed that there is a .cs file that is generated from the .tt file. I'm trying to figure out if that is n...
Seaver asked 10/4, 2014 at 13:5

2

Solved

I have just downloaded sharparchitecture/Northwind and i'm trying to get crud scaffolding to work. I have changed nothing except adding missing reference to this class library. I try to run Scaffol...
Lingam asked 9/2, 2011 at 13:15

0

I'm looking for a way to make use of an assembly referenced by the project with an alias (i.e. other than global) from a runtime T4 template. My goal is to be able to reference a namespace, with a...
Gamone asked 9/4, 2014 at 11:59

2

Solved

How do you disable T4 Template validation . VS2010 is validating my T4 Template just now on ever part that has '#' (the sharp character). error CS1040: Preprocessor directives must appear as the f...
Ac asked 22/12, 2010 at 14:0

2

Solved

I have a Windows Store Application that use a portable class library with a T4 template. When I run the transformation it fails with the following error: Compiling transformation: The type 'System...
Cesya asked 28/6, 2013 at 17:54

2

Solved

When I generate the Context using EF Power Tools reverse engineering, it created a class with my DB name in a file with my DB name. I was able to modify the T4 template to use a static name for the...
Candancecandela asked 25/4, 2013 at 20:37

2

I have a VS project that contains: a pre-build action running TextTransform on a template.tt to generate generated.cs generated.cs listed as one of the files to compile (i.e. in the list of proje...
Feinstein asked 18/8, 2009 at 11:36

1

Solved

I am using EF code first method in my project. Recently I updated EF version of my project to EF 6 using Package Manager Console. All of my entities are inherited from a BaseEntity class as a supe...
Sigmoid asked 9/2, 2014 at 6:52

5

Is it possible to write t4 template ( or if it already exists ) which will be able to generate DTO classes based on the data in the *.edmx file? I have to write DTO classes for the current project...
Sennar asked 6/7, 2011 at 14:19

1

Solved

Is there a way to add a new Scaffold or override the Scaffolding functionality used in the new Visual Studio 2013 Scaffolding? The only documentation I can find on the internet is how to override ...

1

Solved

For our application, we do not use Visual Studio in the build process; Visual Studio is not on the build servers. In general, we have kept Visual Studio as a "nice to have" for developing the appli...
Erkan asked 3/1, 2014 at 16:0

3

Solved

What is the difference between the <# tag and the <#+ tag in T4?
Ichnography asked 2/8, 2010 at 3:12

2

Solved

I'm currently working with T4 templates and I have noticed that sometimes the code is not indented properly, how can I avoid that? For instance I have this code in the template } <# } #> ...
Lippizaner asked 12/12, 2013 at 8:17

6

Solved

I have a T4 template for a class set up with TextTemplatingFileGenerator Custom Tool in Visual Studio: <#@ template language="C#v3.5" hostspecific="True" debug="True" #> <# var className...
Miniver asked 11/1, 2010 at 14:17

0

I was able to get my T4 file to work properly when I run it within visual studio but it errors out when automating it to happen during the build process automatically. The problem is that in order...
Conventioneer asked 10/12, 2013 at 22:14

1

Solved

In Visual Studio, what does the menu command "Build" => "Transform All T4 Templates" do?
Sarcenet asked 6/12, 2013 at 0:14

3

I'm trying to do some experiments with generating code from VS2012 projects but I cannot make this piece of t4 code to work var project = VisualStudioHelper.CurrentProject; since VisualStudioHel...
Martinet asked 16/7, 2013 at 20:11

© 2022 - 2024 — McMap. All rights reserved.