The answer is 42 dear Watson.

A collection of posts made in the hope that they will be useful for a tired wayward traveler in search of a solution. Of course, the ultimate answer is 42.

Visual Studio Project Creation Wizard and Templates

Visual Studio Project Creation Wizard and Templates

  • Comments 1

I found an interesting feature when creating a Visual Studio project template. (Details about how to create a template is left to a forthcoming post.) I was working on a wizard for the project template.

In the IWizard::RunStarted method for the wizard, when you add items to the replacementsDictionary parameter, Visual Studio seems to take the values and substitute them into the template files. This is not surprising since this is what it is advertised to do. What is interesting is the difference in how the variables are named.

 For example, when referring to the project name in a template file, you would use the construct $safeprojectname$. However, let's say you have something in a template file such as "myVariableName". If you add an entry in the replacementsDictionary with a key named myVariableName with value someVariable, then the fragment "myVariableName" in the template file is turned into "someVariable". This is different from the other construct's. Which is interesting since I am not sure if this is documented anywhere.

Comments
Leave a Comment
  • Please add 5 and 7 and type the answer here:
  • Post