CreateProjectAction doesn't replace parameters regardless of ReplaceParameters value in vstemplate
- 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
- Hi Kevin,There is a known issue with it, please check the workaround that I wrote here http://weblogs.asp.net/jescrich/archive/2007/10/05/dealing-with-the-unfoldtemplateaction-and-parameter-replacement.aspx. The post is about the UnfoldTemplateAction but it's the same thing. It also fix a common problems with the template path parameter so with it, you can specify relative paths to your current guidance package.HTH.Jose.
Jose Escrich - weblogs.asp.net/jescrich- Marked As Answer byKevinH1979 Friday, September 11, 2009 11:07 AM
- Proposed As Answer byJose Escrich Thursday, September 10, 2009 5:03 AM
All Replies
- Hi Kevin,There is a known issue with it, please check the workaround that I wrote here http://weblogs.asp.net/jescrich/archive/2007/10/05/dealing-with-the-unfoldtemplateaction-and-parameter-replacement.aspx. The post is about the UnfoldTemplateAction but it's the same thing. It also fix a common problems with the template path parameter so with it, you can specify relative paths to your current guidance package.HTH.Jose.
Jose Escrich - weblogs.asp.net/jescrich- Marked As Answer byKevinH1979 Friday, September 11, 2009 11:07 AM
- Proposed As Answer byJose Escrich Thursday, September 10, 2009 5:03 AM
Hi Jose
Thanks for your help ... issue resolved.
Cheers
Kevin


