lcj

Does the .vstemplate in the Templates\Solutions\Projects folder automatically in the GA Development Project automatically run when you create the GA Project I did not see a reference to it in the package xml file using the Guidance Package Development package.

Re: Visual Studio Guidance Automation Toolkit How does the .vstemplate run?

vga

The only thing that GAX will do regarding .vstemplate files is to register them for you. These project and item templates will unfold then the user does a File->New Project, Project->Add, etc.

So for example, if you drop a .vstemplate inside Templates\Solutions folder of your guidance package, GAX will register it in a way that VS will make the template appear when you do File->New Project->Giudance Packages->YourGuidancePackageName->YourTemplateFile. If the user then clicks on this template, it will just unfold, you don't need to reference it from your package xml file for this to happen. What you could do (from your guidance package xml file) is to add a reference to a recipe, so that when the user unfolds the mentioned template, GAX will first run your recipe, possibly collection data using a Wizard, then it will pre-process the template (so you could parameterize it using GAX arguments) and lastly the template will be passed to VS for unfolding.

Does this helps

thanks,

-Victor.

'




Re: Visual Studio Guidance Automation Toolkit How does the .vstemplate run?

lcj

I see in the Guidance Package Development project that the initial solution adds two projects to the solution. I see how they are created in the SampleSolution.vstemplate file. I am trying to find how it gets called. I see the CreateSolution recipe which gathers the values used in the SampleSolution.vstemplate. This happens when you first create a new solution based on the package. In the CreateSolution.vstemplate there is a reference to the CreateSolution recipe (<WizardData><Template Recipe="CreateSolution">).

I am having trouble understanding how to kick off a recipe/template when the solution is first created.





Re: Visual Studio Guidance Automation Toolkit How does the .vstemplate run?

vga


You have a vs template in "Templates\Solutions", this is usually a multi-project template that references two or more .vstemplates that are project templates inside "Templates\Solutions\Projects". Once VS starts unfolding the multi-project template then referenced project templates will unfold automatically as part of this process. The <Template Recipe=""> you're seeing is what will tell GAX to execute the specified recipe as part of the unfolding process.

Which part is not clear

thanks,
-Victor.







Re: Visual Studio Guidance Automation Toolkit How does the .vstemplate run?

lcj

So any vstemplate within "Templates\Solutions" will be run when the package is first created



Re: Visual Studio Guidance Automation Toolkit How does the .vstemplate run?

vga

No, not any. Just one. These are "solution" templates, so the user will be able to only choose one from the UI, which will be the one that is "run" (unfolded actually).




Re: Visual Studio Guidance Automation Toolkit How does the .vstemplate run?

lcj

So if there is only one solution template it runs without asking the user to choose The Guidance Packages that the Guidance Package Development project creates do not ask the user they just seem to automatically run the SampleSolution.vstemplate. What you're saying if I understand you correctly (sorry I'm trying to muddle my way through this GA stuff) is that if there is one vstemplate in the Template/Solutions root directory, it will run.



Re: Visual Studio Guidance Automation Toolkit How does the .vstemplate run?

vga

Not quite that. You may have one or more .vstemplates at "Templates/Solutions", GAX will show one entry for each one under the File->New Project->Guidance Packages->YourPackageName.

So far, they will only appear as templates the user may choose.

Now, to have any of them run, the user will need to explicitly go to File-> New Project->Guidance Packages-YourPackageName->TemplateA or TemplateB to cause it to "run" or unfold.

There nothing in GAX such as "automatic" unfolded of templates, as this won't really make much sense in this case, as it is the user the one that needs to determine which solution template wants to use.

Is this more clear now





Re: Visual Studio Guidance Automation Toolkit How does the .vstemplate run?

lcj

Excellent. Thank you.