I have a C# solution with multiple projects. We use central package management.
Project1.csprojProject2.csprojDirectory.Packages.props
In Directory.packages.props we have:
<Project><ItemGroup><PackageVersion Include="DependencyPackage1" Version="2.00.1" /></ItemGroup></Project
DependencyPacakge1 references several other packages: SubPackage1 and SubPackage2
In my solution Project1 references the entire DependencyPackage1. It also references Project2.
However, in Project2 I only want it to reference SubPackage2.
Question: How can Project2 just reference SubPackage2 without having to specify the version? I want it to reference the sub package for DependencyPackage1.
I want to do this so that I only have to manage a single dependency version for DependencyPackage1. If the version on that package changes and SubPackage2 version changes, then I know I don't have to worry about updating it. I realize this can cause other potential issues, but I'm not worried about that right now.