Compile a .NET project without restoring dependencies

dotnet publish

  • Publish a .NET application and its dependencies to a directory for deployment to a hosting system.
    More information: <https://learn.microsoft.com/dotnet/core/tools/dotnet-publish>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

dotnet publish --no-restore {{path/to/project_file}}

click the source code to copy install dotnet publish on any operating system with command-not-found.com