moving the <None> items into targets to force correct ordering #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow up for Order of projects in solution file affects build results
Original reproduction here
The blog here mentions how to include generated file. This case was a bit specific and required slightly different setup because the wasn't enough to enforce correct ordering.
Basically the issue is that if the item isn't within a target, it is resolved during Evaluation phase - e.g. as soon as the project file is loaded into the MSBuild, but ProjectReference that is setting up the project dependency ordering is a Target so this happens:
By moving the item into a custom target and forcing order by setting AfterTargets, the files are moved correctly. Tests pass.
Interestingly enough, since the files are not processed further, another(albeit rather weird) way to have a working build without using the target is to run the build twice. This both made my reproduction attempts somewhat unwieldy and hinted me to a correct solution.
Kudos for Jan Krivanek for letting me know about the MSBuildism blog and to Jenny Bai for her work on reproducing the issue and collecting the logs.