-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why using Directory.Packages.props for non CPM related settings #491
Comments
Yeah, that's a good catch. We should separate them. Honestly I forgot there were 2 directory.*.props files... (and it would actually be nice, IMO, if there were just one but given that there are two and each one has its own responsibilities I agree we should split them out). |
Perfect :) I can make a PR in the next days. Should Build, because it’s just a property as everything else which basically just enables CPM for every project. The Packages file would then just contain packages and nothing else Packages, because it’s related to CPM which aligns with the documentation of CPM |
I don't have a strong preference. If there's a standard, officially or de facto, we can use that. Absent one, I'd say put it in Build (and having it will force the existence of Packages). |
Central Package Management | Microsoft Learn says:
I don't feel like this is a standard or a recommended way, so I 'd put it in Build to. I'm going to start with the PR now. |
I do agree all the other build properties like But unless I am reading this section of the Central Package Management docs incorrectly, I believe the Directory.Packages.props: <Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
</Project> |
@KyleMcMaster This is exactly what I meant. But still I think this is no enforcement and no recommendation nor best practice. Logically this just sets a property for every project and such things belong into the |
Based on my read of the docs I think if we were only doing package dependencies at the folder level I'd put the directive in the packages file, but since we have a Build props file anyway I think it makes sense to put it there and just have the package listing in the packages file. |
@ardalis Makes sense! 👍 |
…uild.props (#491) (#498) Co-authored-by: Steve Smith <[email protected]>
Recently
TreatWarningsAsErrors
(#440) andTargetFramework
(#481) moved intoDirectory.Packages.props
. While I can totally understand why it‘s now configured at a central place I‘m unsure why it moved to the CPM related file. Isn‘t this something that should be located inDirectory.Build.props
? Or am I missing something here?In my opinion the Packages file should only contain CPM related stuff while the Build file should contain everything else.
The text was updated successfully, but these errors were encountered: