I am creating a .NET tool project:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PackAsTool>true</PackAsTool>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>
</Project>
I run dotnet pack and get a nuget package including System.Text.Json inside. I want to trim the tool to keep it small and use the .NET framework installed on client computer. I know it is possible using dotnet publish command with properties SelfContained=false and PublishTrimmed=true, but that will not create a .NET tool