Skip to content

Commit 1fb53bf

Browse files
committed
docs: the package version management strategy
1 parent b92e85e commit 1fb53bf

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ For instance, an API gateway will be in place between the front and the back, to
4545

4646
Again, simplicity has been the main drive point for this learning project.
4747

48+
## Packages version management
49+
50+
This project make use of the NuGet's [Central Package Management (CPM)](https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management) in order to remove duplication of versions of certain packages that are used in different projects (some `ASP.NET` and testing ones).
51+
52+
For trickier scenarios (or when working with older versions than .NET 6) where CPM is not a good fit, another solution would be:
53+
1. Central `.props` files in which versions for packages are defined once by means of [variables](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-properties?view=vs-2022).
54+
2. Define a `Directory.Build.props` to import the previously created `.props`.
55+
3. On each `.csproj`, reference the given variables for the target packages.
56+
57+
> [!NOTE]
58+
> If desired, this also allows having different versions of the same package in different projects e.g. to allow gradually migrating to a new version of a third party library that introduces breaking changes. Mind issues with inconsistencies on transitives dependencies scenarios, though.
59+
4860
# Testing
4961

5062
- [e2e tests](./Desktop.Tests/e2e/README.md)

0 commit comments

Comments
 (0)