MSBuild-交换机定义包括参数 [英] MSBuild - Switch defination include parameters

查看:71
本文介绍了MSBuild-交换机定义包括参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我使用visualStudio 2012创建了一个新项目,并尝试为该项目定义规则.

I create new project using visualStudio 2012 and try to define rules to the project.

我在xml文件中声明:

I declare in the xml file:

1.命令行.

  < StringProperty
    名称="CommandLineTemplate"
     DisplayName =命令行"
    可见="False"
     IncludeInCommandLine ="False"; />

  <StringProperty
      Name="CommandLineTemplate"
      DisplayName="Command Line"
      Visible="False"
      IncludeInCommandLine="False" />

2.EnumProperty:

2. EnumProperty:

 < EnumProperty
   Name ="Updatefiles"
   DisplayName =更新标题文件"
  说明=如何处理结果文件"
  Category ="General1" >
  < EnumValue
    Name ="1"
   DisplayName ="$ [ProjectDir]"
  &Description =移动头文件Desc"
   Switch =''&#x0D;&#x0A;复制$(ProjectDir)%(文件名)IDs.h $(ProjectDir).. \&#x0D;&#x0A;移动$( ProjectDir)%(Filename)Names.xml $(ProjectDir).. \"/>

 <EnumProperty
  Name="Updatefiles"
  DisplayName="Update Header files"
  Description="What to do with result files"
  Category="General1" >
  <EnumValue
   Name="1"
   DisplayName="$[ProjectDir]"
   Description="Move header files Desc"
  Switch="&#x0D;&#x0A;copy $(ProjectDir)%(Filename)IDs.h $(ProjectDir)..\&#x0D;&#x0A;move $(ProjectDir)%(Filename)Names.xml $(ProjectDir)..\"/>

 < EnumValue
    Name ="2"
    DisplayName =删除标头文件"
   Description =删除头文件Desc"
    Switch ="&#x0D;&#x0A; del/F/Q $(ProjectDir)$(文件名)IDs.h&#x0D;&#x0A; del/F/Q $(ProjectDir)$(文件名)Names.xml"/>
  
  < EnumValue
   Name ="3"
    DisplayName =移至项目目录"
   Description =移至项目目录Desc"
    Switch =''&#x0D;&#x0A;移动$(ProjectDir)$(文件名)IDs.h $(ProjectDir)&#x0D;&#x0A;移动$(ProjectDir )$(文件名)Names.xml $(ProjectDir)"/>
 </EnumProperty> 

  <EnumValue
   Name="2"
   DisplayName="Delete header files"
   Description="Delete header files Desc"
   Switch="&#x0D;&#x0A;del /F /Q $(ProjectDir)$(Filename)IDs.h&#x0D;&#x0A;del /F /Q $(ProjectDir)$(Filename)Names.xml"/>
  
  <EnumValue
   Name="3"
   DisplayName="Move to project directory"
   Description="Move to project directory Desc"
   Switch="&#x0D;&#x0A;move $(ProjectDir)$(Filename)IDs.h $(ProjectDir)&#x0D;&#x0A;move $(ProjectDir)$(Filename)Names.xml $(ProjectDir)"/>
 </EnumProperty> 

道具文件包含以下内容:

The prop file contains the following:

< CommandLineTemplate>" $(SolutionDir)Utils \ CreateStringsFile.exe -path&#x0D;&#x0A;移动$(ProjectDir)%(Filename).dat  [Updatefiles]<//CommandLineTemplate>

<CommandLineTemplate>"$(SolutionDir)Utils\CreateStringsFile.exe -path &#x0D;&#x0A;move $(ProjectDir)%(Filename).dat [Updatefiles] "</CommandLineTemplate>

当我打开propertyPage时,当按Command Line-< CommandLineTemplate>的参数时,根据xml文件的定义,UI看起来不错.成功用正确的值替换,但参数 在< EnumValue>的Switch中使用.没有替换.

While i open the propertyPage, the UI looks fine according the xml file defination BUT when the press on Command Line - the parameters that used it the <CommandLineTemplate> succesfully replaced with the correct value BUT the paramerts that used in the Switch of the <EnumValue> not replaced.

可以请您帮忙吗?

谢谢

荔枝

推荐答案

嗨Lilach,

Hi Lilach,

感谢您在MSDN论坛中发帖.
 
我将请一些专家来解决这个问题,看看他们是否可以为您提供帮助.可能会有一些时间延迟,感谢您的耐心配合.
 
感谢您的理解和支持.
 
最好的问候,

Thank you for posting in the MSDN Forum.
 
I will involve some experts into this issue to see whether they can help you out. There might be some time delay, appreciate for your patience.
 
Thank you for your understanding and support.
 
Best regards,


这篇关于MSBuild-交换机定义包括参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆