Use the Microsoft.Build.NoTargets SDK
mainThe Microsoft.Build.NoTargets MSBuild project SDK is designed for projects that do not need to compile an assembly. It is ideal for utility projects that perform tasks such as copying files, building packages, or running external tools. By using this SDK, you avoid the default compilation targets associated with standard SDKs like Microsoft.NET.Sdk.
<Project Sdk="Microsoft.Build.NoTargets">
<!-- Project content here -->
</Project>