Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Use of ExpressionEvaluatorValueProvider in VS2008
 

Use of ExpressionEvaluatorValueProvider in VS2008

Hi

I created a Guidance Package in VS2005. To upgrade the package for use with VS2008, I followed Jose's instructions in an earlier post (http://social.msdn.microsoft.com/Forums/en-US/vsgatk/thread/8777845e-f7c6-4314-a9a3-69943b9409a0)

My Guidance Package installed fine. I have a recipe that unfolds a solution template containing a number of projects. I want the name of each project to be prefixed by the value of another argument for consistent naming. To do this, I created an argument:

<

Argument Name="ProjectPrefix" Required="true">

<

Converter Type="Microsoft.Practices.RecipeFramework.Library.Converters.RegexMatchStringConverter, Microsoft.Practices.RecipeFramework.Library" Expression="^[\w*.?]*[^\W]$"/>

</

Argument>

I then created a number of other arguments (to represent the names of the projects in the solution) and use the ProjectPrefix argument to prefix the project name I wantede.g.

<
Argument Name="AppName">

<

Converter Type="Microsoft.Practices.RecipeFramework.Library.Converters.RegexMatchStringConverter, Microsoft.Practices.RecipeFramework.Library" Expression="^[\w*.?]*[^\W]$"/>

<

ValueProvider Type="Evaluator" Expression="$(ProjectPrefix).AppName">

<

MonitorArgument Name="ProjectPrefix" />

</

ValueProvider>

</

Argument>

So the name of the "AppName" project will be$(ProjectPrefix).AppName. However, when I unfold the solution the project is named with the first letter of the Project Prefix argument:

  1. So if the ProjectPrefix is "MyTestApp"
  2. The value of AppName should be (and in the wizard it is) "MyTestApp.AppName".
  3. However, when unfolded the created project is named "M.AppName". Only the first letter of the ProjectPrefix arg is used. I know there is nothing wrong with the value of the argument as I use the same argument in the associated AssemblyInfo.cs file and the substitution is correct.

If I install my Guidance Package for VS2005 and run the same functionality it works!

AmI missing some important difference between templates in VS2005 /VS2008?

Thanks
Kevin

KevinH1979  Tuesday, September 22, 2009 4:04 PM
To add to this, the version of GAX on my development machine is 1.4.0.0

The version of GAX on the machine I am installing to is 1.4.0.9. I notice from the related link on microsoft.com some Regular Expression Evaluation Enhancements have been made.
http://www.microsoft.com/downloads/details.aspx?FamilyID=E28205C6-BB07-401B-9A76-804784598BF0&displaylang=en

Could this be a symptom of the different GAX version?

Has anyone noticedsimilar issues when using this newer version of GAX?
KevinH1979  Tuesday, September 22, 2009 5:02 PM
Further update on this ... it looks to me like there's a limit on the amount of arguments that can monitor a single argument.

There are 9 "project name" arguments monitoring the ProjectPrefix argument. If I comment some of these guys out e.g.so that only 3 arguments are monitoring the ProjectPrefix argument, the created projects (when the solution is unfolded) have the correct name.

Looks to me like there's some sort of limit on the amount of arguments that can monitor a single argumentwhen usingVS2008 / GAX 1.4.0.9.

Can someone from Microsoft confirm /deny this for me?

Thanks
KevinH1979  Tuesday, September 22, 2009 6:16 PM
Hi,

GAX v.1.4.0.9 includes an enhancement Regex evaluator (note that the original one wasn't removed for compatibility reasons, so you will find two, the newest one ending in '2'). I would recommend you give it a try to the newest one and let us know if your problem persists.

thanks,
-vga.
Edit your T4 templates -> http://www.visualt4.com
vga  Thursday, October 15, 2009 2:09 PM

You can use google to search for other answers

Custom Search

More Threads

• Problem on installing GAT
• SMART CLIENT SOFTWARE FACTORY Is not completely installed....Help Please!
• Can't get Recipe arguments into template - using UnfoldTemplateAction
• Unable to install GAX June CTP - States Visual Studio 8.0 is not installed
• ValueProvider for the first selected Item in a project?
• Call T4 Action
• GAX and templates in VS
• GAT in VB.NET?
• Can't run the Guidance Package
• Error using CreateProjectAction - Invalid URI: The URI is empty..