Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > CreateProjectAction doesn't replace parameters regardless of ReplaceParameters value in vstemplate
 

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!

KevinH1979  Tuesday, September 08, 2009 10:31 AM
Hi Kevin,

There is a known issue with it, please check the workaround that I wrote herehttp://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
  •  
Jose Escrich  Thursday, September 10, 2009 5:03 AM
Hi Kevin,

There is a known issue with it, please check the workaround that I wrote herehttp://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
  •  
Jose Escrich  Thursday, September 10, 2009 5:03 AM

Hi Jose

Thanks for your help ...issue resolved.

Cheers
Kevin


KevinH1979  Friday, September 11, 2009 11:07 AM

You can use google to search for other answers

Custom Search

More Threads

• Files don't copy to UnitTesting Out folder ?
• Upgrading Repository Factory to run in VS2008
• Template runs as part of the target solution but does not run as part of a Guidance Package
• Enable recipie if assembly reference exist
• Creating a non C# project template using GAT
• Smart Client Software Factory (Recipe Framework Error) during Enable and Disable Packages
• Help with an error message
• Creating projects in a subdirectory
• GAT/GAX Automated build for TFS
• How to find a NULL in a dataset ?