Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix directions for publish trimmed #43880

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 6 additions & 20 deletions docs/core/deploying/trimming/trim-self-contained.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,34 +55,20 @@ For more information, see [Publish .NET apps with .NET CLI](../deploy-with-cli.m

### Publish with Visual Studio

01. In **Solution Explorer**, right-click on the project you want to publish and select **Publish**.
01. In **Solution Explorer**, right-click on the project you want to publish and select **Properties**.

:::image type="content" source="../media/trim-self-contained/visual-studio-solution-explorer.png" alt-text="Solution Explorer with a right-click menu highlighting the Publish option.":::
:::image type="content" source="../media/trim-self-contained/vs-project-properties.png" alt-text="Solution Explorer with a right-click menu highlighting the Properties option.":::

If you don't already have a publishing profile, follow the instructions to create one and choose the **Folder** target-type.
01. Choose **Build** > **Publish**.

01. Choose **More actions** > **Edit**.
:::image type="content" source="../media/trim-self-contained/vs-build-publish.png" alt-text="Visual studio publish page with Publish Trimmed option.":::

:::image type="content" source="../media/trim-self-contained/visual-studio-publish-edit-settings.png" alt-text="Visual studio publish profile with edit button.":::
01. Select **Publish trimmed** to publish your app trimmed.

01. In the **Profile settings** dialog, set the following options:

- Set **Deployment mode** to **Self-contained**.
- Set **Target runtime** to the platform you want to publish to.
- Select **Trim unused code**.

Choose **Save** to save the settings and return to the **Publish** dialog.

:::image type="content" source="../media/trim-self-contained/visual-studio-publish-properties.png" alt-text="Profile settings dialog with deployment mode, target runtime, and trim unused assemblies options highlighted.":::

01. Choose **Publish** to publish your app trimmed.
:::image type="content" source="../media/trim-self-contained/vs-publish-trimmed.png" alt-text="Visual studio publish page with Publish Trimmed selected.":::

For more information, see [Publish .NET Core apps with Visual Studio](../deploy-with-vs.md).

### Publish with Visual Studio for Mac

Visual Studio for Mac doesn't provide options to publish your app. You'll need to publish manually by following the instructions from the [Publishing with the CLI](#publish-with-the-cli) section. For more information, see [Publish .NET apps with .NET CLI](../deploy-with-cli.md).

## See also

- [.NET Core application deployment](../index.md).
Expand Down
Loading