0

I can't get System.Data.SqlClient to flow over my project references even though one of the projects is dependent of it.

SqlClientDependent project .csproj:enter image description here

ProjectReference to SqlClientDependent project:enter image description here

When i build SqlClientDependent project the bin folder gets:enter image description here

But when i build the Project that references SqlClientDependent project, the System.Data.SqlClient is not included in bin folder, and i, ofcourse, get a runtime error beacuse the SqlClientDependent project clearly needs the SqlClient package. Anyone understand why?

jarlh
  • 42,561
  • 8
  • 45
  • 63
Easten
  • 37
  • 8
  • 1
    What kinds of projects are these - "old style" or SDK-style? I'd normally just use a `` instead of the ``. That should work transitively, I believe. – Jon Skeet Oct 11 '21 at 11:45
  • SqlClient dependent projekt is "old style" (.net framework 4.6.1) and project referencing it is a new SDK-style project (.net 5.0). I think i'll remove my dependecy to System.Data.SqlClient from legacy project and try to use Microsoft.Data.SqlClient. But still cant figure out why it would skip the dependency.... – Easten Oct 11 '21 at 16:05
  • I believe it's just a matter of dependencies not being transitive by design in old style projects. Basically it's an old problem :( – Jon Skeet Oct 11 '21 at 16:25

0 Answers0