none
nothing is working as expected RRS feed

  • Question

  • ok, maybe someone can explain me this

    I did build a rule...

    This rule has a StringProperty... and I tried to use values like "Separator", "SwitchPrefix" and "Switch" ... and... I did this also on other properties of type StringListProperty.

    The behaviour is not as expected. For some rules it seems to work, for some others not (means e.g. the Separator isn't used)... and the behaviour seems to change depending on definitions of the "Inputs" and "CommandLineTemplate" properties. And maybe the order also has an influence...

    I really don't see a pattern here why and when something happens...

    So... someone knows how to use all those things? Or why I see such strange behaviour? Is there something I have to know? E.g. some backwards compatibility stuff that plays into it? Or some ordering rules I don't know? or... I don't know...

    Rudolf

    Sunday, October 20, 2019 11:07 PM

All replies

  • Hi Rudolf,

    Welcome to the MSDN forum.

    Not sure which step you missed. In general, we can create a custom xml file which defines your own property or other build rules and then import it into your project to use it.

    Besides, please remember to configure the specific command-line parameters in the project properties.

    Please refer to these two articles to get professional guidance throughout the creation process:

    https://www.codeproject.com/Articles/881782/Creating-custom-UI-property-pages-sheets-in-Visual

    https://www.codeproject.com/Articles/883954/Creating-Custom-UI-Property-Pages-Sheets-in-Visu

    Note: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you. 

    Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, October 21, 2019 7:43 AM
  • I know those articles...

    What I don't know are things like this: It seems, that if you add a "Command Line" page, then you need an "AdditionalOptions" property. If you don't have it, you get errors when opening it. And, if you add more options, they don't show up.

    That's all... pretty strange. And even Visual Studio itself (for the cl for example) is doing stuff that I don't understand. But... I'm trying to investigate this now.

    Rudolf

    Monday, October 21, 2019 9:58 AM
  • Hi Rudolf,

    Thanks for your feedback.

    I'm sorry that the first reply didn't help you. So l am trying to involve someone more experienced in this topic.

    l have escalated this issue to the VS support team and if there is any responses ,we will post it here in time.

    Thanks for your understanding and patience.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, October 21, 2019 11:41 AM
  • If you have a "CommandLineTemplate" everything changes... and maybe also the existence of something like a Switch with a "[value]" inside.

    Maybe that's documented somewhere, but I didn't see that until now... maybe now that I'm explicitly searching for that. Who knows... but with a CommandLineTemplate defined, the options show up with only the "Switch" value. Nothing else... no value, no separator, no pre... ok, maybe the prefix, didn't check that. But the others don't show up.

    Which is strange... because... I don't see why it is like that from the source code.

    If I use a CommandLineTemplate of "[AllOptions] [AdditionalOptions]" (which should do the same like not having a template), then it simply adds all the Switch-Values to the command line... without parameter and for all options, even those that are not set. E.g. instead of "/option1 value /option2 value" I see "option1 option2 option3 option4 option5" ... ?? what's wrong here?

    Rudolf



    Monday, October 21, 2019 12:29 PM
  • Hi Rudolf

    Sorry for the late response!

    Seems like you're using VS2010 which support to customize build rules with CommandLineTemplate. Only find one public document about this, put it here for your reference:

    https://devblogs.microsoft.com/cppblog/quick-help-on-vs2010-custom-build-rule/

    According to the above link, the output of CommandLineTemplate is depending on the MASM.targets file's definition.

    In VS2010, due to the migration to MSBuild, the information in the rules file is represented by three files: .XML, .props and .targets files. The XML file defines the property and switch mapping. The props file initializes the property values and the targets file generates the task based on the XML file and has the build logic. MASM and LIC custom build rules are also shipped in VS2010 with this new format.

    And start from VS2015, the way of custom build changed, you can check it at here:

    https://docs.microsoft.com/en-us/cpp/build/how-to-add-custom-build-tools-to-msbuild-projects?view=vs-2015

    Thursday, October 31, 2019 9:42 AM