Visual Studio Developer Center > Visual Studio Forums > Visual Studio Guidance Automation Toolkit > CreateProjectAction doesn't replace parameters regardless of ReplaceParameters value in vstemplate
Ask a questionAsk a question
 

AnswerCreateProjectAction doesn't replace parameters regardless of ReplaceParameters value in vstemplate

  • Tuesday, September 08, 2009 10:31 AMKevinH1979 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi

    I'm trying to use the CreateProjectAction to add a project to an existing solution. The action is working fine, in that the project and associated files are created.

    However, parameters within the csproj file are not replaced. Let me give an example. In my recipe, I have an argument:

    <

     

    Argument Name="SnkFileName">

    <

     

    ValueProvider Type="AIC.GuidedAutomation.ValueProviders.SnkNameValueProvider, AICGuidancePackage">

    <

     

    MonitorArgument Name="SnkFileNameToUse" />

    </

     

    ValueProvider>

    </

    Argument>

     

    Argument>

    Argument>

     

     

    which returns a path to the snk file to be used when signing a project. I have checked the recipe and the argument definitely has a value before the CreateProjectAction action is run. My CreateAction action looks like this:

    <

     

    Action Name="CreateIISHostProject" Type="Microsoft.Practices.RecipeFramework.Library.Actions.CreateProjectAction, Microsoft.Practices.RecipeFramework.Library">

    <

     

    Input Name="ProjectName" RecipeArgument="IisHostName" />

    <

     

    Input Name="Template" RecipeArgument="IisHostTemplatePath" />

    <

     

    Input Name="ProjectFolder" RecipeArgument="ProjectPath" />

    <

     

    Output Name="Project" />

    </

     

    Action>

    In the vstemplate file I indicate that ReplaceParameters property is set to true for parameters in my csproj file:

     

    <

     

    Project TargetFileName="AICApplicationIISHost.csproj" File="AICApplicationIISHost.csproj" ReplaceParameters="true">

    In the csproj file of the project to be added using CreateProjectAction, I have the following setting:

    <

     

    PropertyGroup>

    ...

     


    <
    AssemblyOriginatorKeyFile>$SnkFileName$</AssemblyOriginatorKeyFile>

    </

     

    PropertyGroup>

     

     

    However, after the CreateProjectAction is executed the value $SnkFileName$  is not replaced with the value of the argument in the currently executing recipe.

    Can anyone see what I'm doing wrong or has anyone else had a similar experience?

    Thanks!

Answers

All Replies