In some projects I need to add NuGet package Microsoft.Data.SqlClient to the project before I can do
using Microsoft.Data.SqlClient
In other projects, I can do that without explicitly adding the NuGet package. The examples below are both .NET 6.0 projects (same for .NET 5).
I am wondering how this works. Is the package referenced indirectly somehow?
AspNetCore.HealthChecks.SqlServer
depends on Microsoft.Data.SqlClient
:
so as transitive dependency Microsoft.Data.SqlClient
becomes available for you also.