Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Passing a XmlSerializer Class To T4 template
 

Passing a XmlSerializer Class To T4 template

I want to use T4 in order to create my costumer classes.
Ineed to pass XmlSerializer Classto template and start file generation.

Is it possible?
Thank you


- Andrea Bianchi - site: http://www.BianchiAndrea.com
BianchiAndrea.com  Friday, April 24, 2009 2:47 PM
You have several options, depending on how the code selecting the file is implemented: http://www.olegsych.com/2008/04/t4-template-design/. It sounds like this code is implemented in a Visual Studio Add-on, so "Standalone Template" may be the best approach.
Oleg
Oleg V. Sych  Monday, April 27, 2009 10:11 AM
Does this work?

<#@ assembly name="System.Xml" #>
<#@ import namespace="System.Xml.Serialization" #>
<#
    XmlSerializer serializer = new XmlSerializer(...);
    // ... 
#>

Oleg
Oleg V. Sych  Friday, April 24, 2009 3:38 PM
To better explain, Igive youmore details of my scenario.
I have a generation code who iterate in directory and select many file with some criteria.
I want thatgeneration code use T4 in order to generate class from the XmlSerialized Class of single file selected.
How can I do in order to pass the XmlSerialized Class "selected" to the T4 template.

The solution that you give me is not the same? Rght?

Another idea?

Thks.
- Andrea Bianchi - site: http://www.BianchiAndrea.com
BianchiAndrea.com  Monday, April 27, 2009 7:29 AM
You have several options, depending on how the code selecting the file is implemented: http://www.olegsych.com/2008/04/t4-template-design/. It sounds like this code is implemented in a Visual Studio Add-on, so "Standalone Template" may be the best approach.
Oleg
Oleg V. Sych  Monday, April 27, 2009 10:11 AM

You can use google to search for other answers

Custom Search

More Threads

• classname value
• GAX/GAT 2007 July installation problem
• HoLPackage Registration menu disappear
• Will we see an updated GAT Toolkit soon?
• Access is Denied Error when installing Guidance Automation Packages / Guidance Automation Toolkit
• Failed to create business module
• T4 in a custom tool
• 2008 New Nike Football Shoes in www.shoes198.com
• how to add website project
• The file cannot be opened with the selected editor