Все вопросы: [t4]
97 вопросов
Простая и практичная генерация кода C # (VS 2008 или 2010)
Я отложил использование сгенерированного кода как части процесса сборки, опасаясь сложности, которую он привносит в процесс сборки. Есть ли простой способ интегрировать код, сгенерированный во время сборки, в приложение? Тип кода, о котором я думаю, похож на генерацию кода файла ресурсов ...
Указание пути частичного просмотра с помощью T4MVC
Я использую T4MVC в нашем проекте ASP.NET MVC. На мой взгляд, у меня есть подобное утверждение: <% Html.RenderPartial(MVC.SomeController.Views.PartialViewName); %> Что раньше было так: <% Html.RenderPartial("../SomeController/PartialViewName"); %> Раньше он работал н...
TextTransform.exe, похоже, принимает только старую версию С #
Когда я расширяю шаблоны T4 внутри Visual Studio, я могу использовать полный синтаксис C # 3.0, включая выражения LINQ и т. д. Когда я расширяю его за пределами Visual Studio с помощью TextTransform.exe, он жалуется на выражения LINQ и другие новые функции C # 3.0..Есть ли более новая версия Tex...
Шаблоны Sparc T4 для ASP.NET MVC
Мне было просто любопытно, существуют ли уже какие-либо шаблоны Spark T4, которые соответствуют / похожи на готовые шаблоны представления веб-форм (создание, редактирование, детали и т. д.).Мои навыки работы с Google не привели меня ни к каким результатам.
Получите Visual Studio для запуска шаблона T4 при каждой сборке
Как получить шаблон T4 для вывода результатов при каждой сборке?На данный момент он восстанавливает его только тогда, когда я вношу изменения в шаблон. Я нашел другие вопросы, похожие на этот: Преобразование T4 и порядок сборки в Visual Studio (без ответа) Как получить файлы t4 для с...
Как заставить Visual Studio 2008 регенерировать код из шаблонов T4 при изменении файла XML?
Я генерирую довольно много кода из одного файла XML, но шаблоны организованы в два разных шаблона T4.Всякий раз, когда я меняю файл XML, я должен не забыть открыть два файла *.tt, тривиально изменить их (добавить / удалить пробел) и снова сохранить, чтобы убедиться, что код сгенерирован. Это ...
Могу ли я программно использовать T4 из C #?
Я пишу программное обеспечение, которое создает код C #.В основном я использую StringTemplate и StringBuilder. Есть ли способ использовать шаблоны T4 прямо из моего кода?
Auto-generate a strongly-typed AppSettings class
Here's the question first: Is this possible? I'm taking my inspiration from Joe Wrobel's work (a redux of the forgotten Codeplex project). Here, you do your work on creating your profile for the provider, and it does the legwork of creating the strong typing for it, effectively creating a facade...
How do I refresh the SubSonic T4 Template generated code?
I've just started using SubSonic 3 and I'm using the ActiveRecord T4 template. If I make a change in the database (add a column to a table for example), what is the correct method for forcing the code produced by the T4 templates to be re-generated? At the moment I'm just deleting the ActiveRec...
How can I specify T4 (Text Templates) to use C# 4.0, in VS2010?
I need to specify my T4 to use C# 4.0, to render my tt files? I tried using <#@ template language="C#v4.0" debug="true" #> But when I use a dynamic variable, like this dynamic x=10; Write(x.ToString()); I'm getting these errors Error 2 Compiling transformation: Predefined type '...
Change Default MsTest Unit Test Wizard Template
My team is using the unit test wizard, but has found the amount of cruft generated annoying. Is there anyway to modify this template? Thanks
T4 Template to generate first cut of GUI (aspx) derived from database?
I'm wondering if anyone has come across any existing T4 templates to reverse engineer a database into a first cut at an ASPX GUI. It would be nice to be able to design your database, run it through a code generator for the data access layer, but also generate a simple GUI. As a simple example, ...
How can I use T4 templating with MonoDevelop 2.2 on OSX
I understand MonoDevelop supports MVC and uses an implementation of T4 to generate code. Is there a way to utilize T4 with my own templates? I am using MonoDevelop 2.2 Alpha (MonoTouch preview builds) on OSX Snow Leopard. Mono 2.4.2.3 is also installed (which is required for the MonoTouch prev...
Visual Studio + Subsonic 3 + Multiple Projects + "transform all templates" problems
I am using Visual Studio + Subsonic 3 + Multiple Projects + T4 Templates + "transform all templates" and I have two projects each with their own DB and associated activerecord.tt files etc. Then I right click each tt file in select run custom tool - all is OK BUT when I click on "transform a...
Get Project or Relative Directory with T4
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 files together which are located relative to the template. I need to get a reference to there absolut...
Distributing microsoft.visualstudio.texttemplating.dll with custom app
We are writing an app that will use T4 to generate Flex/Actionscript to compile into SWF. We would like to distribute this app to users who will not have VS. I've searched and searched and could not find any info anywhere on redistributing microsoft.visualstudio.texttemplating.dll with your apps,...
T4 Templates - SubSonic 3 - Running at Build Time
How do you get the SubSonic 3 T4 templates to rerun prior to building in VS2008? I don't have to continually "Run Custom Tool" on each one?
Compile error using SubSonic ActiveRecord templates in Visual Web Developer Express
Thanks to ranomore I was able to get the Subsonic T4 code generation to work in Visual Web Developer Express for my ASP.Net MVC project, however only using the LinqTemplates. When I use the ActiveRecord templates with the same settings my project does generate files, but the code doesn't compile...
T4 template error
The error is: Error 48 A processor named 'PropertyProcessor' could not be found for the directive named 'property'. The transformation will not be run. The following Exception was thrown: System.IO.FileNotFoundException: Failed to resolve type for directive processor PropertyProcessor. at...
Product of build-time T4 transformation is used only in the next build
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 project files) When I build the project, the pre-build action is executed, generated.cs is re-created, ...
Getting started with T4
I want to start writing T4 templates. I've heard a lot of great a things about these templates (in the Hanselminutes podcast mainly) and would like to know more. What are the best locations to look for info on T4 template writing? What do I need to get started implementing my own templates? Are t...
T4, XML data source and relative path in Visual Studio 2008
I recently implemented a quick T4 template to generate some data access related classes in our app (Thanks Oleg). One problem I am facing is that my template does need to read data from an XML file that is part of the solution. Obviously, the path to the XML data must be relative. But when I fir...
Tricks for quickly turning DB table into html markup for aspx page?
Does anyone have any tricks for quickly laying out the asp.net html markup for a specific database table? For example, say I have a table "Company", and I just want to render a textbox for all the columns. One trick that I thought I saw and confirmed to work was to do some markup like so: &l...
Anybody know of any T4 templates for generating classes from xsd?
I'm looking at some work updating classes generated from xsds. I think this would be a great use of T4 templates, but I don't see any examples of people doing this. Essentially, I'd like to do what Linq to XSD has done, but without including alpha build targets in a production solution. Any re...
How can I use custom methods inside a T4 template which resides in another assembly
I have a dll called utilities which contains some helper methods and I want to use one of the helper methods inside a T4 template like
Getting the SubSonic MVC Templates to work with my database
I downloaded and installed the SubSonic MVC templates. I'm able to create a new project from this template and the 'prewritten' views work fine. I'm able to edit records from the Artist table of the included 'Chinook' database. So now I'd like to get this to work with MY database. Here's what I...
Get argument value from TextTransform.exe into the template
I can't found some example how can I use argument -a when I use TextTransform.exe to generate code from templates. In MSDN is following description for argument -a: "Specifies a parameter that a directive processor can query for as a name/value pair. The directive processor and identifi...
Installing Subsonic - adding Text Templates does nothing
I'm trying to start using Subsonic (v3). The brief installation instructions indicate that I must: add a reference to the DLL = Done edit Setting.ttinclude to use right connection string = Done; added appsettings to web.config add templates to project = Done, but nothing is generated; no errors...
SubSonic 3.0.0.2 Structs.tt
The error I'm getting seems to be coming out of the Structs.tt file. I'm using the Northwind db and only using the Products table (I excluded all other tables). I return Json(Product.All()). Here's the error: A circular reference was detected while serializing an object of type 'SubSonic...
T4 Code Generation missing in Visual Studio 2008?
So I decided to roll up my sleeves and try out the T4 code generation built into VS2008. I was going to work off of this article: http://www.olegsych.com/2008/09/t4-tutorial-creatating-your-first-code-generator/ So, I get to this part: "Click Project->Add New Item in the main menu and selec...