1

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.