Yet another assembly publicizer/stripper
AssemblyPublicizer.Publicize("./Test.dll", "./Test-publicized.dll");
dotnet tool install -g BepInEx.AssemblyPublicizer.Cli
assembly-publicizer ./Test.dll
- publicizes
assembly-publicizer ./Test.dll --strip
- publicizes and strips method bodies
assembly-publicizer ./Test.dll --strip-only
- strips without publicizing
<ItemGroup>
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.1" PrivateAssets="all" />
<!-- Publicize directly when referencing -->
<Reference Include=".../TestProject.dll" Publicize="true" />
<ProjectReference Include="../TestProject/TestProject.csproj" Publicize="true" />
<PackageReference Include="TestProject" Publicize="true" />
<!-- Publicize by assembly name -->
<Publicize Include="TestProject" />
</ItemGroup>
works with both .NET (generates IgnoresAccessChecksTo attributes) and Mono (AllowUnsafeBlocks)