Binternal

June 8, 2026 Β· View on GitHub

Status Made in Ukraine Build Version Downloads Discord Fuck Russia

Development of this project is entirely funded by the community. Consider donating to support!

Icon

Binternal is an MSBuild extension that lets you internalize package and project references by merging them into the output assembly as internal APIs. This effectively allows you to treat any dependency as a private implementation detail, which can be useful to reduce the exposed surface area of your package or when targeting execution scenarios where proper dependency resolution is not available.

Terms of use[?]

By using this project or its source code, for any purpose and in any shape or form, you grant your implicit agreement to all the following statements:

  • You condemn Russia and its military aggression against Ukraine
  • You recognize that Russia is an occupant that unlawfully invaded a sovereign state
  • You support Ukraine's territorial integrity, including its claims over temporarily occupied territories of Crimea and Donbas
  • You reject false narratives perpetuated by Russian state propaganda

To learn more about the war and how you can help, click here. Glory to Ukraine! πŸ‡ΊπŸ‡¦

Install

  • πŸ“¦ NuGet: dotnet add package Binternal

Usage

In order to internalize a dependency, mark its corresponding PackageReference or ProjectReference with the Internalize attribute set to true:

<ItemGroup>
  <!-- Add the Binternal package to enable support for the Internalize attribute -->
  <PackageReference Include="Binternal" PrivateAssets="all" />

  <!-- This package will be merged into the output assembly -->
  <PackageReference Include="CliWrap" Internalize="true" PrivateAssets="all" />
</ItemGroup>

Note

Consider also adding the PrivateAssets="all" attribute to references that are being internalized. This will make sure they are not passed as transitive dependencies to downstream consumers, which is important if you're building a NuGet package.

When the above project is built, CliWrap.dll, along with all of its own dependencies, will be merged into the output assembly. Public members exposed by this package will be converted into internal members, preventing them from being accessed by outside callers.