From b3d41f71e28a2abacfb11a37ee6ba62846513d1c Mon Sep 17 00:00:00 2001 From: Axel Navarro Date: Thu, 10 Sep 2020 21:33:43 -0300 Subject: [PATCH] dotnet-publish: add page (#4321) --- pages/common/dotnet-publish.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pages/common/dotnet-publish.md diff --git a/pages/common/dotnet-publish.md b/pages/common/dotnet-publish.md new file mode 100644 index 0000000000..ca54e3b400 --- /dev/null +++ b/pages/common/dotnet-publish.md @@ -0,0 +1,28 @@ +# dotnet publish + +> Publish a .NET application and its dependencies to a folder for deployment to a hosting system. +> More information: . + +- Compile a .NET project in release mode: + +`dotnet publish --configuration Release {{path/to/project_file}}` + +- Publish the .NET Core runtime with your application for the specified runtime: + +`dotnet publish --self-contained true --runtime {{runtime_identifier}} {{path/to/project_file}}` + +- Package the application into a platform-specific single-file executable: + +`dotnet publish --runtime {{runtime_identifier}} -p:PublishSingleFile=true {{path/to/project_file}}` + +- Trim unused libraries to reduce the deployment size of an application: + +`dotnet publish --self-contained true --runtime {{runtime_identifier}} -p:PublishTrimmed=true {{path/to/project_file}}` + +- Compile a .NET project without restoring dependencies: + +`dotnet publish --no-restore {{path/to/project_file}}` + +- Specify the output directory: + +`dotnet publish --output {{path/to/directory}} {{path/to/project_file}}`