Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > An Alternate way to create a Deployment Project for a Guidance Package
 

An Alternate way to create a Deployment Project for a Guidance Package

In the link below

http://social.expression.microsoft.com/Forums/en-US/vsx/thread/a41db1fe-b479-43c1-8b6c-5bf1919df9cc

Craig Skibo mentioned that "Deployment Projects" are not suproted by the "Export Template" function.

I need to create a Recipe for my Guidance Package that can iterate through a Solution and pick out the items that are needed for depolyment.

I am currently creating an Action (that will be used in a Recipe) that isusing the ENVDTE.DTE object to create a Deployment Project. I am using the ENVDTE.Solution.AddFromFile() method, passing in a location of a Deployment Project Skeleton that I made.

Is this the best way to accomplish this? Does anyone have any available examples of creating Deplyoment Projects though Actions or a complete Recipe that builds a Deployment Project?

I am currently using the "Guidance Package Development Template " from the Guidance Automation Toolkit for Visual Studio 2008 as my starting point.

Look forward to an thoughts and/or suggestions.

Regards,
CNazman
CNazman  Wednesday, January 07, 2009 9:31 PM
Hi,


You can use the below methods to add items to the solution or project from template.

If you need to add project to the solution using templates:
http://msdn.microsoft.com/en-us/library/ms228767.aspx

that is, you need to use the methods: GetProjectTemplate() and AddFromTemplate()

If you need to add project items from templete you can use this technique:
http://msdn.microsoft.com/en-us/library/ms228774.aspx

that is, you need to use the methods: GetProjectItemTemplate() and AddFromTemplate()


Additional link, How to: Migrate Code that Creates Projects by Using Templates:
http://msdn.microsoft.com/en-us/library/ms228762.aspx


Of corse, you need to use this from your Actions class, and invoke it from your recipe.


In DSL tool you can use directly the .zip with the template content:

http://msdn.microsoft.com/en-us/library/bb126425.aspx

In this case you can add the lines:
<vsProjectTemplates>
<vsProjectTemplate localeId="1033" targetDirectories="CSharp" templatePath="Files\WizardUIP.zip" />
</vsProjectTemplates>
I add it in the setup project in the install definition file (.dslsetup), but in this case is used because dsl doesn´t have the actions and recipies and the dynamism that has GAX.


In GAX you have the .vstemplate files to create template and you can use the it with the action "UnfoldTemplateAction", it is in GAX Extensions Library.

In this example: http://hortha.spaces.live.com/blog/cns!EEFCF44280C54412!123.entry?wa=wsignin1.0&sa=559252894
you can see how to use the UnfoldTemplateAction, with the .vstemplate

<Action Name="UnfoldDataLayerProjectTemplate"
Type="UnfoldTemplateAction"
Template="Solutions\Projects\DataLayer\DataLayer.vstemplate">
<Input Name="Root" RecipeArgument="SolutionArgument" />
<Input Name="DestinationFolder" RecipeArgument="DataLayerProjectFolder" />
<Input Name="ItemName" RecipeArgument="DataLayerProjectName" />
<Output Name="NewItem" />
</Action>


Another link: http://social.msdn.microsoft.com/forums/en-US/vsgatk/thread/5e2059a0-9dd5-4647-a713-2e85b8669e57

If you export a template and open the .zip file, you can see inside the .vstemplate file and additional files necessary to create the template.
http://msdn.microsoft.com/en-us/library/ms185291(VS.80).aspx

You can disassemble the zip and add it into your GAX project, and then use the UnfoldTemplateAction to load it


In resume, in DSL solution you can use the zip directly (in the deploy operation) because you don´t have the potencial that you have in GAX, In GAX you have the UnfoldTemplateAction actions (or custom actions) and DTEEnv API.


I hope I have been helpful

greetings




Leandro Tuttini
Leandro Tuttini  Thursday, January 08, 2009 2:20 PM
Hi Leandro,

Yes your explainations and descriptions have been very helpful. Thanks you so much for taking the time to answer my question. I have been reviewing the information today.

I think at this point I am going to focus on creating my own Template and use the "UnfoldTemplateAction" to insert the templated project into the solution. From there I will interogate the solution and its projects for the files needed to add to the deployment project.

Regards,
Carlos

CNazman  Thursday, January 08, 2009 10:18 PM

You can use google to search for other answers

Custom Search

More Threads

• How do you add a using/reference to a t4 template?
• updating receipe arguments in a "ForEach" action
• How to pass parameters to T4 templates using GAX?
• Programatically moving Projects within a Solution
• Future Roadmap for GAT
• What determines whether project templates are or are not available in context?
• Discovering "out" parameters in source code?
• Unfoldtemplate getting information out of the RunStarted methode "replacementsDictionary"
• SCSF May 2007. Adding Components to the toolbox
• Error unfolding project template