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 wanted e.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:
- So if the ProjectPrefix is "MyTestApp"
- The value of AppName should be (and in the wizard it is) "MyTestApp.AppName".
- 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!
Am I missing some important difference between templates in VS2005 / VS2008?
Thanks
Kevin
All Replies
- 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 noticed similar issues when using this newer version of GAX? - 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 argument when using VS2008 / GAX 1.4.0.9.
Can someone from Microsoft confirm / deny this for me?
Thanks - 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- Proposed As Answer byJose Escrich Friday, November 06, 2009 2:04 PM


