t4 Questions
3
Solved
Hi I am trying to find a way to pass a normal string as a parameter to a text template.
This is my Template code, if someone could tell me what I would need to write in c# to pass my parameters an...
Neckwear asked 11/4, 2013 at 10:47
1
I am creating a .tt file that transforms text into model classes, to practice.
A .cs file is generated that with all models, but I would like each model to be saved in its own .cs file in a differ...
Contradistinguish asked 22/3, 2019 at 9:29
7
Solved
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...
Immensity asked 3/1, 2016 at 15:27
3
I have a .Net standard 2.0 library. In this library I have a T4 file. The file contains these rows.
<#
foreach (MessageType enumValue in Enum.GetValues(typeof(MessageType)))
{
var name = Enu...
Alpaca asked 20/9, 2017 at 16:37
2
Solved
I created a T4 text template (.tt) file in Visual Studio Code, but unlike Visual Studio 2017 (or 2015 ,...) it won't generate the output file after saving the .tt file. How can I generate the outpu...
Lamm asked 7/3, 2018 at 9:16
1
Solved
So I have a T4 Template I'm trying to run at design-time, but it keeps giving me the following error.
Running transformation: System.IO.FileNotFoundException: Could not load
file or assembly 'Sys...
Simmers asked 27/7, 2018 at 3:17
1
Solved
We have a C# T4 file named GenerateProxies.tt which calls several command-line codegen utilities. Using the System.Diagnostics Process class, we redirect the standard output to the T4 output text f...
Bengali asked 6/12, 2016 at 16:44
3
Solved
I have a T4 template that can output either optimized content or standard content based on a flag. Currently I'm manually changing the flag based on my needs.
What I'd love to do is set the flag b...
Klenk asked 7/4, 2011 at 23:28
1
How do you access publish information for use in a T4 Text Template?
For example, I want to create a text template that generates an xml file that will be published with an ASP.Net Core MVC websit...
Cyprus asked 5/9, 2018 at 16:6
7
Solved
We are building an inhouse application which needs to generate HTML files for upload into eBay listings. We are looking to use a template engine to generate the HTML files based on database and sta...
Voorhees asked 21/2, 2010 at 21:40
3
I'm trying to get our T4 templates to run at build time, without adding dependencies on the Visual Studio Modeling SDK. I've successfully used a variant of the batch file shown here, but I now have...
Martell asked 10/12, 2012 at 17:0
8
Solved
I am running Visual Studio 2010 on a Windows 7 virtual machine inside of Parallels Desktop 8 on a Mac Book Pro.
I'm trying to incorporate T4MVC into a new MVC4 project. I installed the T4MVC packa...
Exterritorial asked 3/11, 2012 at 11:36
1
I'm getting a warning from the T4 when the input file is a EF5 edmx.
Running transformation: The input file appears to be using a schema
version not supported by this template. This may lead to...
Plumb asked 4/4, 2013 at 1:47
3
I'm working in a new project under a typical three layer architecture: business, data and client using Angular as a front.
In this project we will have a repetitive task that we want to automate: ...
3
Solved
I'm a T4 newbie trying to use T4 Toolbox to generate F# code based on this answer, but it seems that class feature blocks can't be mixed with statement blocks. Here's my code:
<#@ template lang...
Lillielilliputian asked 17/4, 2010 at 21:8
0
I have a solution with three .NET Core 2 projects. Inside of every project I have several .tt T4 Templates.
I was searching for a smart way to transform all templates at once and found the Transfo...
Cere asked 13/2, 2018 at 13:21
3
Solved
I'm using TextTransform.exe to generate multiple C++ files. Since the tool is not supported directly within Visual Studio for C++ projects I call it by command line (inspired by T4 Generating C++ C...
Whimwham asked 8/12, 2017 at 9:19
1
Solved
VS2017 15.4.1
ASP.NET MVC 5.2.3
T4MVC 4.0.0
AutoT4MVC 1.5.3
Resharper
I have been using T4MVC] for many months in this project without issue. However today each time I change a controller me...
2
I'm trying to use such simple scheme in my project:
Item.cs -> this contains c# partial class with simple entity properties.
It has set also property "Custom Tool: T4ScriptFileGenerator" so it att...
Lure asked 10/5, 2011 at 6:49
2
I'm trying to automate build process for CI server of Silverlight 5 application using OpenRIA Services.
I've got database-first Entity Framework .edmx generated file from which DomainModel is gene...
Sanctimony asked 30/6, 2015 at 9:27
3
Solved
I'm trying to write a T4 template to iterate over a project folder (specified) and generate a js file based on those properties.
I'm able to return my first class file as a ProjectItem (returns a...
Hustler asked 15/3, 2012 at 10:46
6
Solved
I have a solution that has a few projects in it. I'd like to create some T4 templates in one of my test projects to generate tests based on code in another project. The test project has a Project R...
Statfarad asked 23/8, 2010 at 13:31
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 code using a template, but it only...
1
Solved
I wrote a method to get Attribute Value By Property:
public string GetAttributeValueByNameAttributeAndProperty(CodeClass cc, string nameAttribute, string nameProperty)
{
var value = "";
foreach(...
Arsonist asked 29/4, 2015 at 13:28
0
I'm using .Net Core 1.1
I want to generate some codes with T4 in Visual Studio 2017 15.1
MultipleOutputHelper.ttinclude:
<#@ assembly name="System.Core"#>
<#@ assembly name="System.Data....
© 2022 - 2024 — McMap. All rights reserved.