Home > OS >  Reference class libraries
Reference class libraries

Time:06-23

A class library named KMS is referenced to another class library named KMS_.Data in my project. Following is code from KMS.csproj XML file:

<ItemGroup>
    <ProjectReference Include="..\KMS_.Data\KMS_.Data.csproj">
      <Project>{90d7da7b-689c-477a-b4eb-00df1f526fa3}</Project>
      <Name>KMS_.Data</Name>
    </ProjectReference>
  </ItemGroup>

Despite this reference exists between the 2 class libraries, KMS.Models cannot be visible by files inside KMS_.Data class library, for totally unknown reasons. Since this reference exists in KMS.csproj file, I can refer files in KMS_.Data to files in KMS class library but can't do the opposite. Why so? I always thought it worked both ways and not just one. Please help.

Thanks

CodePudding user response:

When u reference a class library A to a class library B, only A can access files in B and not the vice versa. Another poor design belonging to microsoft.

  • Related