I was looking at a solution that uses the https://github.com/microsoft/MSBuildSdks/tree/master/src/CentralPackageVersions. Why can a single package version not be managed via the Directory.Build.props file?
Asked
Active
Viewed 1,321 times
1 Answers
1
A team mate @Oleg Jytnik explained this to me as such:
Directory.Build.props will add the packages to every project by default, but with the CPV, we can only specify the package version and then if we need the packages, we will just add them (w/o the version) to the individual projects. One might ask if instead of the Global Package References provided in Packages.props, if we could use PackageReference in Directory.build.props with the specific version. The problem then might be that since the SDK runs after the Directory.build.props contents are appended, it might see PackageReference with a version and give an error as it expects PackageReference without versions.

Ayushmati
- 1,455
- 1
- 13
- 15