I have two .Net Standard 2.0 library projects: Lib1
and Lib2
, Lib2
depends on Lib1
, Lib1
has class Class1
, Lib2
has class Class2
. Then I create a .Net Core 2.0 and a .Net Framework project:
- The .Net Core 2.0 console application project named
DevInNetCore
which only depends onLib2
, butLib1.Class1
can be accessed in this project. - The .Net Framework 4.6.1 console application project named
DevInNetFramework
which also only depends onLib2
, but nowLib1.Class1
can't be accessed in this project.
My question is: Why Lib1.Class1
can be accessed in the .Net Core project DevInNetCore
since it only depends on project Lib2
? Is there any way to let Lib1
can not be accessed in the project DevInNetCore
?
Here is my demo solution: https://www.dropbox.com/s/u60xjl3i37arcs2/LibTest.zip?dl=0, Visual Studio 2017 may be needed to load the solution.