Open EduardSergeev opened 1 month ago
It is probably not a bug and I now suspect that $(NugetPackageRoot)
is not supposed to be available before Restore
target is executed. Might have been working in previous SDK versions purely by chance. I'll leave my issue as is to confirm.
@EduardSergeev Yes, I believe you're seeing results of https://github.com/dotnet/msbuild/pull/9748.
Issue Description
There seems to be a breaking change introduced in .NET SDK starting from version 8.0.300: During the evaluation stage of the build many NuGet-related properties are no longer populated, for example
$(NugetPackageRoot)
or$(NuGetPackageFolder)
are missing.For example when the same project is build using![image](https://github.com/user-attachments/assets/fef5afe0-e9d7-4463-9106-248d56ddd5b4)
dotnet build -bl
the following NuGet* properties are present in Evaluation stage:With SDK 8.0.206:
While with SDK 8.0.303 only:
(note missing
$(NugetPackageRoot)
)I could not find any relevant information regarding this breaking change (our build is broken since we were relying on
$(NugetPackageRoot)
being set) in release notes so I was wondering if it is undocumented change or a bug? And if there is a way to restore a previous behavior with SDK 8.0.303?Steps to Reproduce
The following minimal project demonstrates the change in behavior:
Expected Behavior
When built using
dotnet build
command from SDK 8.0.206 the following output is produced:The same output is expected under SDK 8.0.300.
Actual Behavior
When built using
dotnet build
command from SDK 8.0.300:Ask us questions
Is it undocumented change or a bug? And if there is a way to restore a previous behavior with SDK 8.0.303?