Skip to content

Don't set MSBuildAllProjects for MSBuild 16.0+#2853

Merged
nguerrera merged 3 commits intodotnet:masterfrom
drewnoakes:msbuild-all-projects
Jan 22, 2019
Merged

Don't set MSBuildAllProjects for MSBuild 16.0+#2853
nguerrera merged 3 commits intodotnet:masterfrom
drewnoakes:msbuild-all-projects

Conversation

@drewnoakes
Copy link
Member

dotnet/msbuild#1299 discusses a change whereby MSBuild prepends the newest project file path to MSBuildAllProjects automatically. Therefore, so long as consumers of this property only use this property for up-to-date checks, it's possible to reduce both the size of this property and corresponding allocations.

This reduction applies equally to consumers, such as for the case discussed in dotnet/project-system#3744.

For backwards compatibility the property is still set for MSBuild versions prior to 16.0.

See also dotnet/msbuild#3605.

//cc: @jeffkl @rainersigwald @davkean

dotnet/msbuild#1299 discusses a change whereby MSBuild prepends the newest input file path to this property automatically. Therefore, so long as consumers of this property only use this list for up-to-date checks, it's possible to reduce the size of this property, and reduce corresponding allocations.

This reduction applies equally to consumers, such as in the case discussed in dotnet/project-system#3744

For backwards compatibility the property is still set for MSBuild versions prior to 16.0.
@jeffkl
Copy link
Contributor

jeffkl commented Jan 22, 2019

This looks good, here was my commit that I hadn't had a change to submit yet:

https://github.com/jeffkl/sdk/commit/0510dc13cb9f1aaa291d5756f35eb17a91cf30df

I'm surprised you didn't have to update the unit test like I had to.

@drewnoakes
Copy link
Member Author

here was my commit that I hadn't had a change to submit yet

If it's safe to remove them outright then that's a better approach, and given your commit we can close this PR.

I'm surprised you didn't have to update the unit test like I had to.

It's marked as Skip. It does look like it should be removed, as you did.

@jeffkl
Copy link
Contributor

jeffkl commented Jan 22, 2019

My commit is from August and I haven't had time to send a PR so feel free to merge this PR instead.

@drewnoakes
Copy link
Member Author

In that case I'll remove the skipped unit test and remove the < 16.0 checks altogether.

Usages of these files will at least run MSBuild 16.0 so the backwards
compatibility is not required.
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 closed #1810 since this will make it super obsolete.

@davkean
Copy link
Member

davkean commented Jan 22, 2019

The CLI will require Dev16, which means if someone tries to use this in Dev15, they will have to do hacks to enable it and we don't support it.

How is that enforced? ie What will prevent this from "just working" if I run MSBuild.exe (v15) against a project that only has 3.0 installed.

@livarcocc
Copy link
Contributor

@davkean the 3.0 CLI has a file that establishes 16.0 as the minimum MSBuild version it requires. This file is then honored by the SDK Resolver that msbuild uses to find the .NET Core SDK props/targets. Users would have to edit this file inside the SDK installation to get around that. At that point, I would say all bets are OFF.

@davkean
Copy link
Member

davkean commented Jan 22, 2019

👍

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.

6 participants