t4

Unmap TT files in VS.NET 2008?

Is there a way to unmap .tt files in Studio? Every time I create or edit one, it warns me about executing them, then creates a .cs file for it. The thing is my .tt files are something completely different. They're Template Toolkit files from Perl project, and their standard extension is .tt I've tried adding an extension map from tt t...

Problem with T4 Templates

Hi, I have the following code and it is giving related to curly braces and stuff. <#@ template language="C#" debug="True" hostspecific="True" #> <#@ output extension=".cs" #> <#@ assembly name="System.Data" #> <#@ assembly name="System.xml" #> <#@ import namespace="System.Collections.Generic" #> <#@ import namespace="System.Data.Sql...

Existing T4 database helpers for DB schema retrieval

Do you know any T4 template which would provide me with bacis DB schema methods and properties (GetTables, GetColumns, MapSqlTypesToClr, etc.)? I know it's easy to retrieve that information, but there are a lot of extra helper functions around it, so why reinvent the wheel? ...

CodeSmith v.s. T4: .netTiers level suite

Has someone ported the netTiers template set to Visual Studio's T4 templates? Or is there a system of similar scope? Does anyone use T4 in a work environment? What (if any) major differences are there between Codesmith and T4? ...

Any T4 Editor for VS 2010 Beta 1?

Hi VS2010 Beta1 was released today and i see lots of T4 usage in Entity Framework and modelling. Is there already an T4 Editor available? ...

Subsonic 3 T4 Templates - Output half of a View to a UserControl

I am using the Subsonic MVC Template and in the List.tt template it loops through all the properties and puts them into an HTML table. I would like that table written to a usercontrol but after a few hours I cannot get it to work properly. The T4 templates can be found here http://code.google.com/p/subsonicproject/downloads/list. ...

Error when attempting to pass a parameter to a t4 template

I'm trying (and failing) to write a simple template file: <#@ template language="C#" hostspecific="True" debug="True" #> <#@ output extension="cs" #> <#@ include file="T4Toolbox.tt" #> <#@ property name="ClassName" processor="PropertyProcessor" type="System.String" #> public class <#= ClassName #> { } When I click on the template in ...

Where are the Unit Test templates in the VS Unit Testing Framework?

I am increasingly annoyed by the unnecessarily verbose template that is used when I create a new unit test in Visual Studio (using the default, included unit testing framework). Instead of public ImportModelStateTest() { // // TODO: Add constructor logic here // } private TestContext testContextInstance; /// <summary> ///Gets or se...

Text templates calling other templates and preserving existing code

I'm just starting to get into generating code from a DSL using visual studio and was looking for help in how to get one template to call multiple sub-templates. I was also wondering if there is any merge features that make it easy to regenerate the code when you make changes to your model without loosing any code that has been added. ...

T4 without Visual Studio?

I'm trying to wireup some code gen templates to my team's automated build process. Our SCM team doesn't want Visual Studio on our build machine (which I have a hard time arguing with). Is there a way to install the T4 engine without Visual Studio? ...

Subsonic 3 SVN Checkout and T4

Hey guys, I am a little confused as to how to get the T4 templates and use them when you pull down the latest code from SVN for Subsonic 3. Are there any instructions anywhere for this or could someone enlighten me? I looked @ the old alpha release and there was a nice _Generated folder that held all of these files. I'm curious what I...

ASP.NET MVC custom T4 templates for views

When I'm adding a new strongly-typed view to an ASP.NET MVC project, I can select between different view content templates (Create Details, Edit, List). I have read these are templates based on the Visual Studio T4 code generation engine. How can I author and configure my own templates and let them appear in the available templates when...

T4 templates newbie question

I am building a product, and I need a way to generate code at the runtime. Currently, I use VB.Net (only for this and nothing else) xml literals (is that what they are called?), to create templates and create code at runtime. My question is, can I use T4 on web server in shared hosting, without VS installed, to generated code at runtime?...

How can I customize WCF client code generation?

Are there any tools or code generation templates that will let me customize and extend the WCF cliend proxies? It's not that svcutil is horribly broken, but rather I'd like to be able to generatate additional code based on the service contract, not just be limited the svcutil output. ...

MvcTextTemplateHost not found

I'm trying to use the T4 templates in my MVC project. This screencast suggests just copying the existing T4 templates for MVC into your solution and going from there. However when I try to compile I get this error: Error 1 Compiling transformation: The type or namespace name 'MvcTextTemplateHost' could not be found (are you missing...

T4 Project Context in VB

How do I convert this to VB.NET?...I already tried running it through some online converters with no luck. Its one of the first lines in a T4 file... var dte = (DTE)((IServiceProvider)Host).GetService(typeof(SDTE)); Here is the VB that is spit out from on online converters: Dim dte As EnvDTE.DTE= DirectCast(DirectCast(Host, IServi...

Using COM objects in a T4 template?

Hi gang, I'm new to Visual Studio's T4 template engine, and I'm wondering how I can use COM objects to build templates. Specifically, SQL-DMO (to generate classes from stored procedures on a SQL 2000 server, SNO is not an option). Have any of you guys done this? Any tips? <#@ import namespace="SQLDMO" #> is not working. Thanks! ...

Can database fields be dragged and dropped (as textboxes, not a gridview) into an ASP.Net form?

In VisualStudio, when you drag and drop a table or an individual column from a data connection in server explorer, a gridview is created. What I want to be able to do is drag and drop the columns to make a quick and dirty detail form to display an individual record. Is this possible in any way? An even better way to do this would be v...

Entity Framework context mock/fake

It should parse EDMX file and create a moch/fake to use in Unit tests. The easiest integration would be by using T4 that we already have in VS IDE. Has anybody seen it on the web? Or is maybe writing it on their own? Or is there an OSS in progress doing this? Anybody? ...

Generate entity class from database table

I need to build a class in this form namespace BestCompanyEver { public class PersonInfo { public string Name{get;set;} public int Age{get;set;} } } From a table Person that has columns Name and Age. Are there any ready to use solutions for this? I know I can implement this with T4 or Codesmith, but there shou...