Added solution directory tree traverse to find the Directory.Packages.props file when AvaloniaVersion is null.
This is needed if the version is defined only globally, and not overridden in the csproj.
Added check for the presence of the PackageVersion tag.
This is needed since the Directory.Packages.props could be the only place where the Version attribute is defined.
Added check for the presence of the VersionOverride attribute.
This is needed since the version used by a project could still be different from the global one, at least in theory.
These changes allow the application to support the Central Package Management feature introduced with NuGet 6.2 / .NET SDK 6.0.300.
I didn't add checks for the validity of either the csproj or Directory.Packages.props, I assume they are both valid since, to allow this application to work correctly, the opened project / solution needs to be built successfully. Besides, I think it isn't this project responsibility to validate the format of these files, but the MSBuild one.
Directory.Packages.props
file whenAvaloniaVersion
isnull
. This is needed if the version is defined only globally, and not overridden in thecsproj
.PackageVersion
tag. This is needed since theDirectory.Packages.props
could be the only place where theVersion
attribute is defined.VersionOverride
attribute. This is needed since the version used by a project could still be different from the global one, at least in theory.These changes allow the application to support the Central Package Management feature introduced with NuGet 6.2 / .NET SDK 6.0.300. I didn't add checks for the validity of either the
csproj
orDirectory.Packages.props
, I assume they are both valid since, to allow this application to work correctly, the opened project / solution needs to be built successfully. Besides, I think it isn't this project responsibility to validate the format of these files, but the MSBuild one.