Lets take the following classical architecture : (vs 2019 net core 3.1)
- One project (A) with Interfaces
- One project (B) with Implementations
- One project (C) that make the mapping with interfaces and implementations.
- One WebSite or consoleApp (D) that reference C and A
In the code of D i can use concrete class of B without build problem even if i dont reference the project. The reference of C bring automatically the B.
I found this thread : In Visual Studio, why are all files automatically part of my C# project? apparently it's a new feature and it would make things easier. But none of the solution works for me.
How can i removed this strange behavior ? If want to be forced to use Interfaces and have a build error if i use implementations in D.
When i right click on my project there is two things : "Load direct dependencies of project" and "Load entire dependency tree of project" this appears to be the solution, but it only open my .csproj in edition...
Thanks !