ARTICLE AD BOX
The quote comes from this video (timestamped) when showing how to set up default package versions in msbuild files.
The "naive" approach (that's not working ?) is extracting the SkiaSharp's Version in Directory.Build.Props
<Project> <PropertyGroup> <SkiaSharpVersion>1.68.1</SkiaSharpVersion> </PropertyGroup> </Project>which then could have been used in the .csproj
<ItemGroup> <PackageReference Include="SkiaSharp" Version="$(SkiaSharpVersion)" /> </ItemGroup>The work-around described is to use Directory.build.targets instead (notice Update):
<Project> <ItemGroup> <PackageReference Update="SkiaSharp" Version="1.68.1" /> </ItemGroup> </Project>and leave the package-reference declaration in the csproj file just to
<ItemGroup> <PackageReference Include="SkiaSharp" /> </ItemGroup>So, my main question is:
Why doesn't the nuget tooling "like" the first approach, but likes the second? Is it ignoring part of the evaluation phase - is it bypassing it entirely..?
Additional clarifications much appreciated in how the nuget tooling plays together with msbuild (couldn't find any links and useful resources).
