Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > How to add a parameter to the path of the file?
 

How to add a parameter to the path of the file?

Hola,

I want to add a parameter to the path of the files included on the project. So, for example, I have the file Templates/Solutions/Projects/ConsoleApplication/ConsoleApplication.csproj and I want to add an item like this;

<Compile Include="$path$\Common\Arrays.sj">
<Link>Arrays.sj</Link>
</Compile>

The idea is that the final developer will set $path$ as ..\..\..\.., but I don't know where to link the project template with argument that I've defined on the xml:

Code Snippet
<Recipe Name="CreateSolution">
<Caption>Collects information for the new sample solution.</Caption>
<Arguments>
<Argument Name="ProjectName">


<Converter

Type="Microsoft.Practices.RecipeFramework.Library.Converters.NamespaceStringConverter,

Microsoft.Practices.RecipeFramework.Library"/>
</Argument>
<Argument Name="WebSiteName">


<Converter

Type="Microsoft.Practices.RecipeFramework.Library.Converters.NamespaceStringConverter,

Microsoft.Practices.RecipeFramework.Library"/>
</Argument>
<Argument Name="Path">


<Converter

Type="Microsoft.Practices.RecipeFramework.Library.Converters.NamespaceStringConverter,

Microsoft.Practices.RecipeFramework.Library"/>
</Argument>
</Arguments>
<GatheringServiceData>
<Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
<Pages>
<Page>
<Title>Initial values for the new solution</Title>
<Fields>
<Field Label="Project Name" ValueName="ProjectName" />
<Field Label="WebSite Name" ValueName="WebSiteName" />
<Field Label="Path" ValueName="Path" />
</Fields>
</Page>
</Pages>
</Wizard>
</GatheringServiceData>
</Recipe>

I think that the $safeprojectname$ is linked using:

<SolutionFolder Name="SampleFolder">
<ProjectTemplateLink ProjectName="$ProjectName$">Projects\ConsoleApplication\ConsoleApplication.vstemplate</ProjectTemplateLink>
</SolutionFolder>

but I don't know what do I have to code to replace the $path$ parameter. Help?

pura vida.

elopio  Tuesday, May 06, 2008 12:16 AM
Hi Leo,

verify if you have enable the paremeter replacement in the vstemplate, like this:
<Project File="xxxxx.csproj" ReplaceParameters="true">

also you can check this out: http://weblogs.asp.net/jescrich/archive/2007/10/05/dealing-with-the-unfoldtemplateaction-and-parameter-replacement.aspx

I wrote an action which fix many of the issues with the parameter replacement when you try to unfold a template.

hth
jose.
Jose Escrich  Friday, May 16, 2008 5:27 PM
Hi Leo,

verify if you have enable the paremeter replacement in the vstemplate, like this:
<Project File="xxxxx.csproj" ReplaceParameters="true">

also you can check this out: http://weblogs.asp.net/jescrich/archive/2007/10/05/dealing-with-the-unfoldtemplateaction-and-parameter-replacement.aspx

I wrote an action which fix many of the issues with the parameter replacement when you try to unfold a template.

hth
jose.
Jose Escrich  Friday, May 16, 2008 5:27 PM

You can use google to search for other answers

Custom Search

More Threads

• ProjectReference
• Database Project template
• Office Resource Kit
• Successful installation - July Vista GAX GAT Software Factory
• unistallation issue with guidence automation and Wssf december 2006 release
• Where is the ConditionalCoordinator to the latest GAX release (Feb)?
• WizardPage doesnot load
• Problems with installing Guidance Extensions and Software Factories.
• GuidancePackage Solution Will Not build
• Custom Wizard with checkbox