Don't set MSBuildAllProjects for MSBuild 16.0+#2853
Conversation
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.
|
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. |
src/Assets/TestProjects/AppWithSharedProject/SharedProject/SharedProject.projitems
Outdated
Show resolved
Hide resolved
If it's safe to remove them outright then that's a better approach, and given your commit we can close this PR.
It's marked as |
|
My commit is from August and I haven't had time to send a PR so feel free to merge this PR instead. |
|
In that case I'll remove the skipped unit test and remove the |
Usages of these files will at least run MSBuild 16.0 so the backwards compatibility is not required.
rainersigwald
left a comment
There was a problem hiding this comment.
🎉
I closed #1810 since this will make it super obsolete.
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. |
|
@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. |
|
👍 |
….7 (#2853) - Microsoft.DotNet.Cli.Runtime - 5.0.100-alpha1.19462.7
dotnet/msbuild#1299 discusses a change whereby MSBuild prepends the newest project file path to
MSBuildAllProjectsautomatically. 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