I have a class library project file like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="InformationLog" Version="2.1.1" />
</ItemGroup>
</Project>
My class library has various public types, such as PublicClass1. The Nuget package InformationLog has a public type named Log. My class library needs Log internally to work, but I don't want to make this type visible to users of my class library. I want people to have access to PublicClass1 but not to Log or any of the other types or namespaces in InformationLog.
I'm OK with keeping InformationLog as a dependency, forcing projects that reference my class library to also use the InformationLog nuget package, I just don't want the types in that Nuget package to be visible.
Ideally I would like some XML in my project file to fix this. Something like this:
<PackageReference Include="InformationLog" Version="1.9.0" Access="Private"/>
Is there a way to do something like that?