See https://github.com/dotnet/runtime/blob/6d0a902c9585d98bfa44f514bac21a47eabe02fa/eng/testing/workloads-testing.targets#L195-L200 as an example.
Because the Restore and Pack target pass the same set of properties in, the underlying project evaluation evaluation is shared. This resulted in msbuild files restored via a PackageReference not being imported during the build.
I have been fixing so many of these code pieces in my career at Microsoft and it would really be helpful if msbuild could somehow indicate that a shared evaluation between Restore and Build or Pack is most certainly wrong. Sure, there are cases where a shared evaluation might be intentional, but that should < 1%.
Related: #2811
cc @akoeplinger @ericstj
See https://github.com/dotnet/runtime/blob/6d0a902c9585d98bfa44f514bac21a47eabe02fa/eng/testing/workloads-testing.targets#L195-L200 as an example.
Because the Restore and Pack target pass the same set of properties in, the underlying project evaluation evaluation is shared. This resulted in msbuild files restored via a
PackageReferencenot being imported during the build.I have been fixing so many of these code pieces in my career at Microsoft and it would really be helpful if msbuild could somehow indicate that a shared evaluation between
RestoreandBuildorPackis most certainly wrong. Sure, there are cases where a shared evaluation might be intentional, but that should < 1%.Related: #2811
cc @akoeplinger @ericstj