t4 Questions

3

Solved

Is there a way to automatically run the T4 transform when another file is saved?
Chadd asked 5/3, 2012 at 15:56

2

Solved

I want to get a reference to assembly of a project in which T4 template is. I know I can get path to the project with, for example Host.ResolveAssemblyReference("$(ProjectDir)") and I could maybe a...
Stipendiary asked 20/12, 2012 at 10:39

2

I have a few [Flags] enums in my code I'd like to expose to JavaScript without copy&pasting. SignalR seems to be doing something similar for their Hub-proxies by mapping an URL to an Action ret...
Cutthroat asked 21/5, 2013 at 14:24

1

Im looking for a way to increase productivity when I add a table to my database. Generally, when I add a new table I have to perform the following steps. Add table to the database (simple) Create...
Hillside asked 13/9, 2013 at 13:23

1

Solved

I recently switched to Entity Framework 5. Now, I want to generate the POCO classes from an existing database and also I need both lazy loading and change tracking. So all the scalar properties sho...
Boland asked 20/8, 2013 at 18:18

1

Solved

I've setup a new laptop and have download (via SVN) some large projects related to my work. I'm now getting a bunch of errors similar to the following. Error 5 The imported project "C:\Program ...
Subeditor asked 4/8, 2013 at 15:50

1

Solved

Is there a way to avoid using hard-coded keys for the globalized strings contained in the resw file within a windows store app? i.e. // I have to use a hard-coded string key, which may violate the...
Hatchel asked 8/7, 2013 at 13:30

1

Solved

I have a T4 template that processes several .tt files in my project. I also have some custom classes I've defined to help with the code transformation process. <#@ template language="C#" hostsp...
Unbosom asked 30/10, 2012 at 18:54

1

Solved

Hi I am just starting out with T4 templates and I need to generate a javascript file based on the actions in my controller. I got the code all figured out forgetting the controllers and actions my...
Five asked 6/6, 2013 at 6:27

4

Solved

I have a T4 template that generates classes from an xml file. How can I add a dependency between the xml file and the template file so that when the xml file is modified the template is rerun aut...
Bethesda asked 11/11, 2008 at 12:22

1

Is there any way to set dynamically the dataannotations according to some values in database? My requirement is like this: Display(Name="DispName")] public string DName{get;set;} Instead of ha...
Rexrexana asked 16/5, 2013 at 11:43

3

What is the advantage of t4 templates over Class files in asp.net? Like we are generating strongly typed class using t4 templates. We can do the same using c# class files in asp.net. So, wha...
Theriault asked 9/5, 2013 at 5:31

1

I am looking to see if Extended Properties can be made to be part of Entities in EF 4.0, when the .edmx is generated or updated from the database. I also would like to see an example of running a s...
Encephalon asked 3/3, 2011 at 17:15

1

Solved

I am working on some T4 code generation, for this I need the CodeClass of the type that is passed inside the constructor of BarAttribute. class Baz { } class Bar : Attribute { public Bar (Type ty...
Paranoia asked 21/6, 2011 at 18:57

1

Solved

I'm using T4Template and codeDOM to create an assembly using the following code: CompilerParameters Params = new CompilerParameters(); Params.GenerateExecutable = true; Params.ReferencedAssembli...
Glazunov asked 2/5, 2013 at 21:40

2

Solved

I have started adding some preprocessed T4 templates to a VS2010 C# library project. They are implementation details only, and I would prefer to not have them exposed on the library's API. I have n...
Ashtonashtonunderlyne asked 16/12, 2010 at 22:25

1

Solved

I'd like to get a list of all public methods in my project that are decorated using MyAttribute using T4/EnvDTE. I know this can be done with reflection, but I don't want to load the assembly and ...
Suicide asked 24/4, 2013 at 16:32

4

Solved

I would like to know what this is MvcTextTemplateHost. I have this in my create.tt but I cant find it in my bin folder (searching with object viewer). I read up and found out it's in my VisualStud...
t4
Marcomarconi asked 12/6, 2011 at 8:6

2

Solved

All, I have a T4 Template <#@ template debug="true" hostSpecific="true" #> <#@ output extension=".cs" #> <#@ Assembly Name="System.Core" #> <#@ Assembly Name="System.Windows....
Papist asked 12/4, 2013 at 23:19

3

Solved

I am generating POCOs (lets say they are subclasses of MyEntityObject) by using a T4 template from an EDMX file. I have 3 entities, e.g.: MyTable1 (PrimaryKey: MyTable1ID) MyTable2 (PrimaryKey: ...
Durman asked 19/3, 2011 at 23:39

1

Solved

I'm using several T4 templates to generate several T4 files, and most of them share a lot of the same code, so naturally I would like to make a function out of it and put it in a different file tha...
Rookery asked 5/4, 2013 at 20:44

2

Solved

I'm using visual studio 2012 to generate XML from a T4 template. The top of the template looks like <#@ template language="VBv4" hostspecific="True" debug="True" #> <#@ output extension="...
Polemoniaceous asked 4/9, 2012 at 8:6

5

I want to create for each entity in my edmx-model a separate class file called {0}Validator.cs (do not care about its content by now). This seems to work, but I can't work it out to prevent my T4 ...
Moist asked 9/5, 2011 at 17:29

2

Solved

<#@ template debug="false" hostspecific="false" language="C#" #> What does hostspecific attribute signify here.
Disenthrall asked 14/3, 2013 at 10:19

0

Can't reference an assembly in a T4 template So when I put <#@ assembly name="$(ProjectDir)$(OutDir)$(TargetFileName)" #> in the T4 template, it says The assembly $(ProjectDir)$(OutD...
t4
Riptide asked 15/3, 2013 at 17:53

© 2022 - 2024 — McMap. All rights reserved.