Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9203465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:28:47+00:00 2026-06-17T23:28:47+00:00

I am using T4 toolbox for cs file generation. But in result generates correct

  • 0

I am using T4 toolbox for cs file generation. But in result generates correct C# files but… without extension. What the problem?

<#@ template language="C#" hostspecific="true" debug="True" #>
<#@ output extension="txt" #>
<#@ include file="T4Toolbox.tt" #>
<#@ include file="$(ProjectDir)StoredProcedures.ttinclude" #>
<#@ include file="DB\SpGenerator.tt" #>
<#
/*
    <auto-generated>
    Do not change files!!
    </auto-generated>
*/
    var generator = new GeneratorSp();
    generator.tableName = ListOfTables();
    generator.Run();

#>



<#@ IntelliSenseLanguage processor="tangibleT4Editor" language="C#" #>
<#@ include file="SpTemplate.tt" #>
<#+ 
public class GeneratorSp : Generator
{
    public string[] tableName;
    protected override void RunCore()
    {
        var _template = new SpTemplate();
        foreach(var sp in tableName)
        {
            _template.SpName = sp;          
            _template.RenderToFile(sp); 
        }
    }
}
#>


<#@ IntelliSenseLanguage processor="tangibleT4Editor" language="C#" #>
<#@ Assembly Name="System.Core" #>
<#@ import namespace="System" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Data" #>
<#@ include file="DataAccess.ttinclude"  #>
<#@ include file="$(ProjectDir)ModelConnectionString.ttinclude"  #>
<#+
// <copyright file="SpTemplate.tt" company="">
//  Copyright © . All Rights Reserved.
// </copyright>

public class SpTemplate : Template
{
    public string SpName;
    public override string TransformText()
    {
        string CONN_STRING = ConnectionString();

        var data = new DataAccess(CONN_STRING);
        var sp   = SpName;
        var pars = data.ParametersDesc(sp);     
        string methodParameters = data.CreateParametersDesc(sp);
#>
namespace B2BSoft.Services.Data.Generated
{
    public  static partial class StoredProcedures
    {
        public static  <#= sp #>_Result <#= sp #>(<#= methodParameters #>)
        {
            return new <#= sp #>_Result();
        }
    }
}
<#+  
        return this.GenerationEnvironment.ToString();
    }
}
#>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:28:48+00:00Added an answer on June 17, 2026 at 11:28 pm

    Pass the file name, including its extension, to the Template.RenderToFile method:

    _template.RenderToFile("FileName.sql");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to run TextTransform.exe to generate code using a T4 template file. The
I am trying to play a .wav file using Audio Toolbox. I have this
For using ServiceInstaller I had to go and add it manually to toolbox, it
I am plotting a financial candlestick chart using this MATLAB function: http://www.mathworks.com/help/toolbox/finance/candlefts.html How do
I am using the stanford Topic modelling toolbox (TMT) http://nlp.stanford.edu/software/tmt/tmt-0.4/ , and I want
I am having a problem with my code. I am using VB.NET and Visual
I built an empty website on VS 2010. Using the toolbox I put a
I have a file format converter on my VS2005 using C#. Now my destination
I have created a gridview using toolbox in c#, it is able to show
Suppose that I performed clustering of iris.data using SOM Toolbox in Matlab. After clustering,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.