We'd like to extract some infrastructure related code (mostly extension methods or small helper classes) into separate NuGet packages.
These packages in no way contain business logic pertaining to either of the services.
But as soon as as we end up having a hierarchy of dependencies between packages we are probably asking for troubles with versioning:
Service1 references package Av1.1 directly and Av2.0 indirectly via referenced package B.
ServiceN references package Av1.5 directly and Av1.3 indirectly via referenced package C.
NuGet does not support side-by-side versions and only one version is used per project. This problem of versioning is relevant for monolithic applications as well though with seemingly significantly fewer possible integration issues.
There are some ideas like not extracting common code and letting it be duplicated across services or just not changing the version of the package forcing every service to work with the same version.
Are there any good recommendations concerning code reuse between services which go well with versioning?