Importing MSBuild Property Sheets

Sysprogs forums Forums VisualGDB Importing MSBuild Property Sheets

This topic contains 0 replies, has 1 voice, and was last updated by  support 1 year, 3 months ago.

Viewing 1 post (of 1 total)
  • Author
  • #24497


    One of our users requested support for importing MSBuild property sheets into VisualGDB variables that could be used in custom actions and various settings, so we are publishing the instructions to achieve this here in case anyone else is looking for a similar feature.

    First of all, create a property sheet file (e.g. test.props) that will define the necessary properties inside a PropertyGroup with the “UserMacros” label:

    Then, add the following lines to the .vgdbsettings file (or the .vgdbcmake/.vgdbproj file when using advanced project types) directly under the VisualGDBProjectSettings2 element:

    The Path element should contain the relative path to the property sheet file that is being imported. You can test it by adding a custom pre-build action running “cmd.exe /c echo $(TestProperty)”. In this example, it will output “TestValue”.

    Although VisualGDB cannot fully evaluate MSBuild conditions, you can use the syntax below to limit the properties imported by VisualGDB:

    This will restrict the imported variables to variables with no condition and variables where the condition is set to exactly ‘$(Configuration)’ == ‘Debug’.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.