Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > UnfoldTempalteAction replacing parameters
 

UnfoldTempalteAction replacing parameters

Hello,

I'm using the UnfoldTemplateAction to unfold a project template in a custom Recipe. The issue I'm having is replacing the $safeprojectname$ tags in the project vstemplate with the ProjectName argument that I get from a custom wizard.

How do I get the safeprojectname parameter to take affect in the UnfoldTemplateAction?

thanks for any help you can provide.

-Jeff

Jeff Paine  Wednesday, September 26, 2007 8:59 PM

Yes, is the same thing using that action the argument won't be replaced. I will try to find outa workaround for this issue.

jose.

Jose Escrich  Thursday, October 04, 2007 8:08 PM

Hi Jeff,

Declare a recipe argument for your project name in your custom recipefor example

<Argument Name="ProjectName" Type="System.String">

<ValueProvider Type="Evaluator" Expression="MyProject"></ValueProvider>

</Argument>

In your project vstemplate file and in other files w.r.t the project, replace all the parameter tags $safeprojectname$ with $ProjectName$

This should work for you, please let me know if you have furthur queries.

Noor.

Noor Mohammed  Thursday, September 27, 2007 11:54 AM

I'm still not getting the projects to rename according to the paramters. Here is what I have, let me know if you have any ideas.

Thanks,

Jeff

...
<Arguments>
<xi:include href="../Common/CommonArguments.xml"
xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Arguments/gax:Argument)" />

<Argument Name="NewSolutionName"/>
<Argument Name="ProjectName" Type="System.String">
<ValueProvider Type="Evaluator" Expression="$(NewSolutionName)"></ValueProvider>
</Argument>
</Arguments>

<GatheringServiceData>
<Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
<Pages>
<Page>
<Title>Specify solution options</Title>
<LinkTitle>Solution options</LinkTitle>
<Fields>
<Field ValueName="NewSolutionName" Label="SolutionName">
</Field>
</Fields>
</Page>
</Pages>
</Wizard>
</GatheringServiceData>
<Actions>
<Action Name="UnfoldDataLayerProjectTemplate"
Type="UnfoldTemplateAction" Template="pathtotempaltes\MyTemplate.vstemplate">
<Input Name="Root" RecipeArgument="SolutionArgument" />
<Input Name="ItemName" RecipeArgument="ProjectName" />
<Output Name="NewItem" />
</Action>

</Actions>

</Recipe>

<VSTemplate Version="2.0" Type="ProjectGroup" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name>MyTemplate</Name>
<Description>TinyTemplate example</Description>
<ProjectType>CSharp</ProjectType>
<SortOrder>100</SortOrder>
<Icon>WCF.ico</Icon>
<CreateNewFolder>false</CreateNewFolder>
<DefaultName>MyTemplate</DefaultName>
<ProvideDefaultName>true</ProvideDefaultName>
</TemplateData>
<TemplateContent>
<ProjectCollection>
<ProjectTemplateLink ProjectName="$ProjectName$.Proj1">MyTemplate\MyTemplate.vstemplate</ProjectTemplateLink>
</ProjectCollection>
</TemplateContent>
<WizardExtension>
<Assembly>Microsoft.Practices.RecipeFramework.VisualStudio, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
<FullClassName>Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate</FullClassName>
</WizardExtension>
<WizardData>
<Template
xmlns="http://schemas.microsoft.com/pag/gax-template"
SchemaVersion="1.0">

</Template>
</WizardData>
</VSTemplate>

Jeff Paine  Thursday, September 27, 2007 3:36 PM

Hi Jeff,

Please provide the error what you are getting while this recipe is getting executed, because its hard to to go thru the code. However, in order to validate your code, you can do one thing. WebClient Software Factory has used UnfoldTemplateActionaction in two of its recipes, you can see them and try to find where you have gone wrong. Youcan find the recipes in the drive where you have installed the factory, by default it would be in the below path

C:\Program Files\Microsoft Web Client Factory\WCSF Guidance Package\Recipes

The factory has used UnfoldTemplateAction in the below two recipes:

CreateWebClientFactoryModule.xml

CreateWebClientFactoryFoundationalModule.xml

Regards,

Noor.

Noor Mohammed  Friday, September 28, 2007 6:36 AM

Hello Noor,

When the project unfolds it is named $ProjectName$.Proj1, I would like the $ProjectName$ to be replaced with the value from the recipe.

Is there something I am missing?

Thank you for your help,

Jeff

Jeff Paine  Friday, September 28, 2007 3:00 PM

Hi Jeff

your approach should work. $ProjectName$ will be replace with the ProjectName argument.

hth

jose.

Jose Escrich  Wednesday, October 03, 2007 4:27 AM

Hello Jose,

I found this post where you suggest that this is not possible with the UnfoldTemplateAction.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2221890&SiteID=1

Is this true? I'm trying to do the same thing as the original poster.

Thanks,

Jeff

Jeff Paine  Thursday, October 04, 2007 6:15 PM

Yes, is the same thing using that action the argument won't be replaced. I will try to find outa workaround for this issue.

jose.

Jose Escrich  Thursday, October 04, 2007 8:08 PM

You can use google to search for other answers

Custom Search

More Threads

• Retrieving Project Information Using EnvDTE
• GAT installation cannot find the GAX
• NotImplementedException on OnComponentChanging/Changed
• Using FileNameEditor as a Value Editor
• How to add a parameter to the path of the file?
• Can't able to run a recipe more than Once
• How to include required softwares in deployment process
• June GAT Installation Issues
• Passing a XmlSerializer Class To T4 template
• How do i create New Guidance Package from existing one?