Before ASP.Net Core:
- I create a MVC site and two class libraries in one solution. Let's say the project names are MVC, Lib1 and Lib2.
- I add references as follows: MVC references Lib1, Lib1 references Lib2.
With this reference structure, MVC cannot access classes in the Lib2 project, which is as expected and what I want.
The same project and reference structure in ASP.Net Core: MVC can access classes in Lib2. Looking at the MVC/References node in the Solution Explorer in Visual studio, you can see MVC/References/DNX 4.5.1/Lib1 - so far so good (I did add a reference to Lib1 from MVC) - but then I can expand the Lib1 node, and will see Lib2 under it. End result: MVC can access Lib2 classes via a reference chain.
I presume this behaviour is by design, but then how can I achieve the old behaviour? I do not want developers to be able to access Lib2 classes from MVC.