Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to access MSBuild's internal properties dictionary #5834

Open
am11 opened this issue Oct 25, 2020 · 0 comments
Open

Way to access MSBuild's internal properties dictionary #5834

am11 opened this issue Oct 25, 2020 · 0 comments
Labels

Comments

@am11
Copy link
Member

am11 commented Oct 25, 2020

In other build systems, we can access the list of tracked variable in a given context and use it for simple debugging. e.g. CMake provides get_cmake_property(allVars VARIABLES), that sets CMake's internal dictionary tracking properties in user variable allVars, which can then be iterated for printing key/values etc.

With MSBuild, we can either use VS for high quality script debugging (of XML files), or we can use plain dumps /v:d[iag], binary log etc. However, I am looking for a more granular control over internal dictionary, which MSBuild uses to track properties' names and current values in the context. Something like:

<Target Name="MyTarget">
  <!-- while running MyTarget in a very large/complex project,
    print/dump list/snapshot of *all* properties known to MSBuild at this point
    (all props include: built-ins, environment vars, custom properties) -->
  <Error
    Message="dumping all props in simple (later-diffable) output:
%(MSBuildPropertiesDictionary.Identity): %(MSBuildPropertiesDictionary.Value)" />

similar discussions:

@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants