开发者

Visual Studio: Custom Build Rules - per solution?

I need to define a custom build rule for files in my projects. However the rule may be different for different solutions (more percisely, for the same solution in a parallel dev branch).

I have two questions:

  1. Can a .rules file be specified in a locat开发者_开发技巧ion relative to the solution? That way I'd be able to create rules per development branch.

  2. MSDN says that the custom rule is inheritable similarly to the properties (vsprops). How can that be achieved? Where do I specify the inheritance?

Thanks,

Gil Moses.


.vcproj file will contain the following clause:

 <ToolFiles>
    <ToolFile
      RelativePath="..\my.rules"
    />
 </ToolFiles>

You can use $(SolutionDir) to customize placement of the .rules file, like this:

 <ToolFiles>
    <ToolFile
      RelativePath="$(SolutionDir)..\..\..\my.rules"
    />
 </ToolFiles>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜