Skip to content
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
8 changes: 4 additions & 4 deletions aspnetcore/host-and-deploy/visual-studio-publish-profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Learn how to create publish profiles in Visual Studio and use them
monikerRange: '>= aspnetcore-2.1'
ms.author: tdykstra
ms.custom: mvc
ms.date: 07/28/2020
ms.date: 04/27/2026
uid: host-and-deploy/visual-studio-publish-profiles
---
# Visual Studio publish profiles (.pubxml) for ASP.NET Core app deployment
Expand Down Expand Up @@ -60,7 +60,7 @@ The [Web SDK](xref:razor-pages/web-sdk) imports the [Razor SDK](xref:razor-pages

To explicitly add a file to the publish list, add the file directly in the `.csproj` file as shown in the [Include Files](#include-files) section.

When selecting the **Publish** button in Visual Studio or when publishing from the command line:
When selecting the **Publish** button in Visual Studio, or when publishing from the command line:

* The properties/items are computed (the files that are needed to build).
* **Visual Studio only**: NuGet packages are restored. (Restore needs to be explicit by the user on the CLI.)
Expand Down Expand Up @@ -135,7 +135,7 @@ The **Publish** tab of the app capabilities page is displayed. Several publish t
* IIS, FTP, Web Deploy (for any web server)
* Import Profile

To determine the most appropriate publish target, see [What publishing options are right for me](/visualstudio/ide/not-in-toc/web-publish-options).
To determine the most appropriate publish target, see [What publishing options are right for me](/visualstudio/deployment/deploying-applications-services-and-components-resources#what-publishing-options-are-right-for-me).

When the **Folder** publish target is selected, specify a folder path to store the published assets. The default folder path is *bin\\{PROJECT CONFIGURATION}\\{TARGET FRAMEWORK MONIKER}\publish\\*. For example, *bin\Release\netcoreapp2.2\publish\\*. Select the **Create Profile** button to finish.

Expand All @@ -149,7 +149,7 @@ Visual Studio's publish tool produces a `Properties/PublishProfiles/{PROFILE NAM
When publishing to an Azure target, the *.pubxml* file:

* Contains the Azure subscription identifier.
* Should not be checked into source control because the subscription identifier is sensitive information.
* Shouldn't be checked into source control because the subscription identifier is sensitive information.

Sensitive information, for example, the publish password, is encrypted on a per user/machine level. The `Properties/PublishProfiles/{PROFILE NAME}.pubxml.user` file contains the information needed by MSBuild to retrieve the user name and password.

Expand Down
16 changes: 8 additions & 8 deletions aspnetcore/host-and-deploy/windows-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Learn how to host an ASP.NET Core app in a Windows Service.
monikerRange: '>= aspnetcore-3.1'
ms.author: tdykstra
ms.custom: mvc
ms.date: 12/19/2022
ms.date: 04/27/2026
uid: host-and-deploy/windows-service
---
# Host ASP.NET Core in a Windows Service
Expand Down Expand Up @@ -51,7 +51,7 @@ The following `Program.cs` calls [`AddHostedService`](/dotnet/api/microsoft.exte

:::code language="csharp" source="~/host-and-deploy/windows-service/samples/7.x/WebAppServiceSample/Program.cs" highlight="8":::

The following sample apps accompany this topic:
The following sample apps accompany this article:

* Background Worker Service Sample: A non-web app sample based on the [Worker Service template](#worker-service-template) that uses [hosted services](xref:fundamentals/host/hosted-services) for background tasks.
* Web App Service Sample: A Razor Pages web app sample that runs as a Windows Service with [hosted services](xref:fundamentals/host/hosted-services) for background tasks.
Expand Down Expand Up @@ -102,7 +102,7 @@ A Windows [Runtime Identifier (RID)](/dotnet/core/rid-catalog) is included in th
To publish for multiple RIDs:

* Provide the RIDs in a semicolon-delimited list.
* Use the property name [\<RuntimeIdentifiers>](/dotnet/core/tools/csproj#runtimeidentifiers) (plural).
* Use the property name [\<RuntimeIdentifiers>](/dotnet/core/project-sdk/msbuild-props#runtimeidentifiers) (plural).

For more information, see [.NET RID Catalog](/dotnet/core/rid-catalog).

Expand All @@ -122,13 +122,13 @@ On Windows OS earlier than the Windows 10 October 2018 Update (version 1809/buil
powershell -Command "New-LocalUser -Name {SERVICE NAME}"
```

Provide a [strong password](/windows/security/threat-protection/security-policy-settings/password-must-meet-complexity-requirements) when prompted.
Provide a [strong password](/previous-versions/windows/it-pro/windows-10/security/threat-protection/security-policy-settings/password-must-meet-complexity-requirements) when prompted.

Unless the `-AccountExpires` parameter is supplied to the [New-LocalUser](/powershell/module/microsoft.powershell.localaccounts/new-localuser) cmdlet with an expiration <xref:System.DateTime>, the account doesn't expire.

For more information, see [Microsoft.PowerShell.LocalAccounts](/powershell/module/microsoft.powershell.localaccounts/) and [Service User Accounts](/windows/desktop/services/service-user-accounts).
For more information, see [Microsoft.PowerShell.LocalAccounts](/powershell/module/microsoft.powershell.localaccounts/) and [Service User Accounts](/windows/win32/services/service-user-accounts).

An alternative approach to managing users when using Active Directory is to use Managed Service Accounts. For more information, see [Group Managed Service Accounts Overview](/windows-server/security/group-managed-service-accounts/group-managed-service-accounts-overview).
An alternative approach to managing users when using Active Directory is to use Managed Service Accounts. For more information, see [Group Managed Service Accounts Overview](/windows-server/identity/ad-ds/manage/group-managed-service-accounts/group-managed-service-accounts/group-managed-service-accounts-overview).

## Log on as a service rights

Expand Down Expand Up @@ -280,7 +280,7 @@ Many startup errors don't produce useful information in the event logs. You can

### Clear package caches

A functioning app may fail immediately after upgrading either the .NET SDK on the development machine or changing package versions within the app. In some cases, incoherent packages may break an app when performing major upgrades. Most of these issues can be fixed by following these instructions:
A functioning app might fail immediately after upgrading either the .NET SDK on the development machine or changing package versions within the app. In some cases, incoherent packages might break an app when performing major upgrades. Most of these issues can be fixed by following these instructions:

1. Delete the *bin* and *obj* folders.
1. Clear the package caches by executing [dotnet nuget locals all --clear](/dotnet/core/tools/dotnet-nuget-locals) from a command shell.
Expand All @@ -296,7 +296,7 @@ A *crash dump* is a snapshot of the system's memory and can help determine the c

#### App crashes or encounters an exception

Obtain and analyze a dump from [Windows Error Reporting (WER)](/windows/desktop/wer/windows-error-reporting):
Obtain and analyze a dump from [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting):

1. Create a folder to hold crash dump files at `c:\dumps`.
1. Run the [EnableDumps PowerShell script](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/host-and-deploy/windows-service/samples/scripts/EnableDumps.ps1) with the application executable name:
Expand Down
11 changes: 6 additions & 5 deletions aspnetcore/mvc/controllers/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Handle requests with controllers in ASP.NET Core MVC
author: ardalis
description: Learn how ASP.NET Core MVC controllers and Actions handle requests and return responses.
ms.author: tdykstra
ms.date: 12/05/2019
ms.date: 04/27/2026
uid: mvc/controllers/actions
---
# Handle requests with controllers in ASP.NET Core MVC
Expand All @@ -29,7 +29,7 @@ A controller is an instantiable class, usually [public](/dotnet/csharp/language-

A controller class must not have an associated `[NonController]` attribute.

Controllers should follow the [Explicit Dependencies Principle](/dotnet/standard/modern-web-apps-azure-architecture/architectural-principles#explicit-dependencies). There are a couple of approaches to implementing this principle. If multiple controller actions require the same service, consider using [constructor injection](xref:mvc/controllers/dependency-injection#constructor-injection) to request those dependencies. If the service is needed by only a single action method, consider using [Action Injection](xref:mvc/controllers/dependency-injection#action-injection-with-fromservices) to request the dependency.
Controllers should follow the [Explicit Dependencies Principle](/dotnet/architecture/modern-web-apps-azure/architectural-principles#explicit-dependencies). There are a couple of approaches to implementing this principle. If multiple controller actions require the same service, consider using [constructor injection](xref:mvc/controllers/dependency-injection#constructor-injection) to request those dependencies. If the service is needed by only a single action method, consider using [Action Injection](xref:mvc/controllers/dependency-injection#action-injection-with-fromservices) to request the dependency.

Within the **M**odel-**V**iew-**C**ontroller pattern, a controller is responsible for the initial processing of the request and instantiation of the model. Generally, business decisions should be performed within the model.

Expand All @@ -43,7 +43,7 @@ Public methods on a controller, except those with the `[NonAction]` attribute, a

Action methods should contain logic for mapping a request to a business concern. Business concerns should typically be represented as services that the controller accesses through [dependency injection](xref:mvc/controllers/dependency-injection). Actions then map the result of the business action to an application state.

Actions can return anything, but frequently return an instance of `IActionResult` (or `Task<IActionResult>` for async methods) that produces a response. The action method is responsible for choosing *what kind of response*. The action result *does the responding*.
Actions can return anything, but they frequently return an instance of `IActionResult` (or `Task<IActionResult>` for async methods) that produces a response. The action method is responsible for choosing *what kind of response*. The action result *does the responding*.

### Controller Helper Methods

Expand Down Expand Up @@ -73,12 +73,12 @@ There are two result types within this category: [View](xref:mvc/views/overview)

* **View**

This type returns a view which uses a model to render HTML. For example, `return View(customer);` passes a model to the view for data-binding.
This type returns a view, which uses a model to render HTML. For example, `return View(customer);` passes a model to the view for data-binding.

* **Formatted Response**

This type returns JSON or a similar data exchange format to represent an object in a specific manner. For example, `return Json(customer);` serializes the provided object into JSON format.

Other common methods of this type include `File` and `PhysicalFile`. For example, `return PhysicalFile(customerFilePath, "text/xml");` returns <xref:Microsoft.AspNetCore.Mvc.PhysicalFileResult>.

#### 3. Methods resulting in a non-empty response body formatted in a content type negotiated with the client
Expand All @@ -94,6 +94,7 @@ Applications typically share parts of their workflow. Examples include an app th
Most filter attributes, such as `[Authorize]`, can be applied at the controller or action level depending upon the desired level of granularity.

Error handling and response caching are often cross-cutting concerns:

* [Handle errors](xref:mvc/controllers/filters#exception-filters)
* [Response Caching](xref:performance/caching/response)

Expand Down
Loading
Loading