Creating multiple files in solution folder using T4 template
up vote
0
down vote
favorite
I am trying to create multiple files in an existing project within the Solution Folder using T4 template, based on tangible T4 template. I followed the steps in the document but can't generate the multiple files with the structure below. There were no errors occurred during the process, so I am expecting that it will generate the files. I've included the codes here, please see below.
MultipleOutputFiles.tt
<#@ template language="C#" hostSpecific="true" #>
<#@ output extension=".cs" #>
<#@ include file="TemplateFileManagerV2.1.ttinclude" #>
<#
var manager = TemplateFileManager.Create(this);
#>
// this output code will be written to MultipleOutputFiles.cs
<#
var fileProperties=new FileProperties();
manager.StartNewFile("Outputfile9.txt","SomeOtherProject","SubFolder", fileProperties);
#>
// this output code will be written to Outputfile2.txt
<#
manager.Process();
#>
for TemplateFileManagerV2.1.ttinclude.tt complete code, you can get from this link TemplateFileManagerV2.1.ttinclude.tt. Take note that there is an error using the .First()
since there is no value in the collection yet, I changed it to .FirstOrDefault()
.
c# visual-studio visual-studio-2017 t4 tangible-t4-editor
add a comment |
up vote
0
down vote
favorite
I am trying to create multiple files in an existing project within the Solution Folder using T4 template, based on tangible T4 template. I followed the steps in the document but can't generate the multiple files with the structure below. There were no errors occurred during the process, so I am expecting that it will generate the files. I've included the codes here, please see below.
MultipleOutputFiles.tt
<#@ template language="C#" hostSpecific="true" #>
<#@ output extension=".cs" #>
<#@ include file="TemplateFileManagerV2.1.ttinclude" #>
<#
var manager = TemplateFileManager.Create(this);
#>
// this output code will be written to MultipleOutputFiles.cs
<#
var fileProperties=new FileProperties();
manager.StartNewFile("Outputfile9.txt","SomeOtherProject","SubFolder", fileProperties);
#>
// this output code will be written to Outputfile2.txt
<#
manager.Process();
#>
for TemplateFileManagerV2.1.ttinclude.tt complete code, you can get from this link TemplateFileManagerV2.1.ttinclude.tt. Take note that there is an error using the .First()
since there is no value in the collection yet, I changed it to .FirstOrDefault()
.
c# visual-studio visual-studio-2017 t4 tangible-t4-editor
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to create multiple files in an existing project within the Solution Folder using T4 template, based on tangible T4 template. I followed the steps in the document but can't generate the multiple files with the structure below. There were no errors occurred during the process, so I am expecting that it will generate the files. I've included the codes here, please see below.
MultipleOutputFiles.tt
<#@ template language="C#" hostSpecific="true" #>
<#@ output extension=".cs" #>
<#@ include file="TemplateFileManagerV2.1.ttinclude" #>
<#
var manager = TemplateFileManager.Create(this);
#>
// this output code will be written to MultipleOutputFiles.cs
<#
var fileProperties=new FileProperties();
manager.StartNewFile("Outputfile9.txt","SomeOtherProject","SubFolder", fileProperties);
#>
// this output code will be written to Outputfile2.txt
<#
manager.Process();
#>
for TemplateFileManagerV2.1.ttinclude.tt complete code, you can get from this link TemplateFileManagerV2.1.ttinclude.tt. Take note that there is an error using the .First()
since there is no value in the collection yet, I changed it to .FirstOrDefault()
.
c# visual-studio visual-studio-2017 t4 tangible-t4-editor
I am trying to create multiple files in an existing project within the Solution Folder using T4 template, based on tangible T4 template. I followed the steps in the document but can't generate the multiple files with the structure below. There were no errors occurred during the process, so I am expecting that it will generate the files. I've included the codes here, please see below.
MultipleOutputFiles.tt
<#@ template language="C#" hostSpecific="true" #>
<#@ output extension=".cs" #>
<#@ include file="TemplateFileManagerV2.1.ttinclude" #>
<#
var manager = TemplateFileManager.Create(this);
#>
// this output code will be written to MultipleOutputFiles.cs
<#
var fileProperties=new FileProperties();
manager.StartNewFile("Outputfile9.txt","SomeOtherProject","SubFolder", fileProperties);
#>
// this output code will be written to Outputfile2.txt
<#
manager.Process();
#>
for TemplateFileManagerV2.1.ttinclude.tt complete code, you can get from this link TemplateFileManagerV2.1.ttinclude.tt. Take note that there is an error using the .First()
since there is no value in the collection yet, I changed it to .FirstOrDefault()
.
c# visual-studio visual-studio-2017 t4 tangible-t4-editor
c# visual-studio visual-studio-2017 t4 tangible-t4-editor
edited Nov 9 at 23:29
asked Nov 9 at 15:15
cris gomez
3910
3910
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53228430%2fcreating-multiple-files-in-solution-folder-using-t4-template%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown