I am creating my own custom T4 Template that integrates with an ADO.NET Entity Framework Model (.edmx file) included in my MVC Web Application.
For Reference
Please take a brief look at the following two URLs.
Scott Hanselman - "T4 Code Generation Visual Studio Best Kept Secret"
Visual Web Developer Team Blog - Quick Start Guide for ...
I am attempting to generate some code via T4 and I am receiving the following error when I include the <#@ template language="VBv3.5"#> directive in my template.
vbc : Command line (0,0) : error BC2006: Compinling transformation: option 'r' requires ':(file_list)
If I use <#@ template language="C#v3.5"#> as my directive it works just f...
D:\Web\CityV2\App_Code\ActiveRecord.tt(0,0) : error CS0006: Compiling transformation: Metadata file 'MySql.Data' could not be found
Let me start by saying I'm using VWD 2008 Express.
These are the steps I've taken so far:
Created an entirely new project
Added references for Subsonic.Core.dll and MySql.Data.dll
Copied Active Record te...
Using T4 code generation, is it possible to access the types defined in the current project?
For example, if I have an interface and I want to delegate its implementation to another class, i.e.
interface IDoSomething {
public void do_something();
}
class DoSomethingImpl : IDoSomething {
public void do_something() {
// ...
I am looking for something that could read external data (e.g. XML) and then generate source code file. Main reason is to have single definition file and then make Visual Studio to generate C# code and IntelliJ to generate java code.
Visual Studio T4 is template engine intended to produce source code.
...
Can you process T4 templates from inside a .NET application? Is that code available to be called? included in a project? licensing?
update: so it does look like you would have to use VS in some way.
...
I'm having problem with SubSonic 3 and multiple Primary Key columns. It seems like it isn't supported via the ActiveRecord T4 script.
In line 173 of Settings.ttinclude
return this.Columns.SingleOrDefault(x=>x.IsPK) ?? this.Columns[0];
It tries to get a Single Primary Key Column and failed.
Any solutions?
...
Anybody know of a good way to create my dtos for use with Entity Framework (not vs 2010 or v4beta) ... I have seen a few examples with t4 but haven't got any to work.
Anybody suggest the best route for this, i will of course use autoampper to map between my entities and my dtos but i don't want to create my DTOs one by one ... is so muc...
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 select Code Generation->File template in the dialo...
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.Schema.DatabaseColumn'.Here's the Stack Trace:
...
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 and no code.
The demo indicates that wh...
Hello,
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 identifier are optional.
This allows par...
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've done.
Changed to connectionstring in...
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 <#=tbl.ClassName.ToProper()#>
...
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 relevant links out there?
Now a wiki. St...
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:
<p><label for="zzzz">zzzz</label><asp:TextBo...
Hi,
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 first implemented it yesterday, it looke...
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 there pitfalls or important things I should...
I have a VS project that contains:
1. A Pre-Build action of running TextTransform on a "template.tt" to generate "generated.cs"
2. "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 done, "generated.cs" is re-created but VS compiles the previous versi...
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 Microsoft.VisualStudio.TextTemplating.VSHo...