VS 2010, Only default values are used for properties in custom build rule

350 Views Asked by At

I am in the process of upgrading my VS2008 project to VS2010. Currently the problem is with the custom build rule file.

I used the wizard to port it to the new version of visual studio and managed to resolve most of the problems.

My custom build rule is defined for the .xxx extension. There is a bunch of options you can configure for this file. I have specified the default values in the .props values and overriden some of them for a specific file. However, looking at the command line that is executed for the file it appears that the default values are being passed instead of the custom values specified for that file.

This is the snipplet of my .props file:

 <ItemDefinitionGroup>
 <MyTool>
  <MTPath>C:\DefaultPath</MTPath>
  ...
  <CommandLineTemplate>
  set MT_Path=%(MTPath)
  call MyTool.exe
  </CommandLineTemplate>

I have been working closely with the masm sample, but I can't figure out what I am doing wrong.

Thanks.

1

There are 1 best solutions below

0
On

I have found the solution, variables should be enclosed with [] braces so they are evaluated correctly.

<ItemDefinitionGroup>
  <MyTool>
    <MTPath>C:\DefaultPath</MTPath>
    ...
   <CommandLineTemplate>
     set MT_Path=[MTPath]
     call MyTool.exe
   </CommandLineTemplate>