I have a solution with 30+ .NET projects where NuGet package versions were previously defined individually across multiple .csproj files.
During migration to Centralized Package Management, I used the CentralisedPackageConverter, which created a single Directory.Packages.props file to manage package versions centrally.
Before migration, one of my test projects (SampleTest.csproj) contained:
After migration:
Directory.Packages.propscontains:
- However,
SampleTest.csprojno longer contains any reference toMicrosoft.NET.Test.Sdk(neitherIncludenorUpdate).
Despite this:
The solution builds successfully
CI/CD pipelines pass without any issues which has the test suite also included.
Questions
Is it expected behavior that
PackageReferenceentries (likeMicrosoft.NET.Test.Sdk) are completely removed from the.csprojduring migration?How is the dependency being resolved if it is not explicitly referenced in the project file?
What is the potential impact or risk of not having
Microsoft.NET.Test.Sdkexplicitly listed in the test project?Should I manually re-add the
PackageReference Include="Microsoft.NET.Test.Sdk"in the.csproj, or is relying onDirectory.Packages.propssufficient?
Can anyone help me here with their thoughts ?