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

Define VSToolsPath property properly #8090

Closed
wants to merge 4 commits into from

Conversation

Forgind
Copy link
Member

@Forgind Forgind commented Oct 26, 2022

Fixes #6607

Context

MSBuild theoretically defines the VSToolsPath property in its app.config/app.amd.config files, but it doesn't actually fire in practice. (You can tell since two of the properties next to it were pulled out and properly defined elsewhere, and that didn't cause "duplicate definition" errors.)

Changes Made

Move both the VSToolsPath and the MSBuildExtensionsPath64 out of the condition and give them proper values. I did have to hardcode 17.0, but that is done in several other places, so I think it appropriate.

Testing

I tried the provided repro before and after this change. This made it not happen anymore.

Also added a unit test.

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's acceptable to remove the fallback behavior like you're doing here. Can you describe what you discovered about the problem and why you think this is the fix?

@Forgind
Copy link
Member Author

Forgind commented Oct 26, 2022

Two things:
It wasn't defined in the first place, so there was no "fallback." {null} never matches where the file was.
And then the other place it looked for VSToolsPath didn't exist with the way I was testing. I can try out other scenarios to see if it's sometimes there or just add it back, since it doesn't really hurt anything. The only actually necessary change to break the repro was adding line 160/190 to app.config/app.amd.config.

@Forgind Forgind closed this Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSBuild has a grudge against $(VSToolsPath)
2 participants