You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Visual Studio publish profiles (.pubxml) for ASP.NET Core app deployment
@@ -60,7 +60,7 @@ The [Web SDK](xref:razor-pages/web-sdk) imports the [Razor SDK](xref:razor-pages
60
60
61
61
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.
62
62
63
-
When selecting the **Publish** button in Visual Studio or when publishing from the command line:
63
+
When selecting the **Publish** button in Visual Studio, or when publishing from the command line:
64
64
65
65
* The properties/items are computed (the files that are needed to build).
66
66
***Visual Studio only**: NuGet packages are restored. (Restore needs to be explicit by the user on the CLI.)
@@ -135,7 +135,7 @@ The **Publish** tab of the app capabilities page is displayed. Several publish t
135
135
* IIS, FTP, Web Deploy (for any web server)
136
136
* Import Profile
137
137
138
-
To determine the most appropriate publish target, see [What publishing options are right for me](/visualstudio/ide/not-in-toc/web-publish-options).
138
+
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).
139
139
140
140
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.
141
141
@@ -149,7 +149,7 @@ Visual Studio's publish tool produces a `Properties/PublishProfiles/{PROFILE NAM
149
149
When publishing to an Azure target, the *.pubxml* file:
150
150
151
151
* Contains the Azure subscription identifier.
152
-
*Should not be checked into source control because the subscription identifier is sensitive information.
152
+
*Shouldn't be checked into source control because the subscription identifier is sensitive information.
153
153
154
154
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.
* 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.
57
57
* 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.
@@ -102,7 +102,7 @@ A Windows [Runtime Identifier (RID)](/dotnet/core/rid-catalog) is included in th
102
102
To publish for multiple RIDs:
103
103
104
104
* Provide the RIDs in a semicolon-delimited list.
105
-
* Use the property name [\<RuntimeIdentifiers>](/dotnet/core/tools/csproj#runtimeidentifiers) (plural).
105
+
* Use the property name [\<RuntimeIdentifiers>](/dotnet/core/project-sdk/msbuild-props#runtimeidentifiers) (plural).
106
106
107
107
For more information, see [.NET RID Catalog](/dotnet/core/rid-catalog).
108
108
@@ -122,13 +122,13 @@ On Windows OS earlier than the Windows 10 October 2018 Update (version 1809/buil
Provide a [strong password](/windows/security/threat-protection/security-policy-settings/password-must-meet-complexity-requirements) when prompted.
125
+
Provide a [strong password](/previous-versions/windows/it-pro/windows-10/security/threat-protection/security-policy-settings/password-must-meet-complexity-requirements) when prompted.
126
126
127
127
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.
128
128
129
-
For more information, see [Microsoft.PowerShell.LocalAccounts](/powershell/module/microsoft.powershell.localaccounts/) and [Service User Accounts](/windows/desktop/services/service-user-accounts).
129
+
For more information, see [Microsoft.PowerShell.LocalAccounts](/powershell/module/microsoft.powershell.localaccounts/) and [Service User Accounts](/windows/win32/services/service-user-accounts).
130
130
131
-
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).
131
+
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).
132
132
133
133
## Log on as a service rights
134
134
@@ -280,7 +280,7 @@ Many startup errors don't produce useful information in the event logs. You can
280
280
281
281
### Clear package caches
282
282
283
-
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:
283
+
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:
284
284
285
285
1. Delete the *bin* and *obj* folders.
286
286
1. Clear the package caches by executing [dotnet nuget locals all --clear](/dotnet/core/tools/dotnet-nuget-locals) from a command shell.
@@ -296,7 +296,7 @@ A *crash dump* is a snapshot of the system's memory and can help determine the c
296
296
297
297
#### App crashes or encounters an exception
298
298
299
-
Obtain and analyze a dump from [Windows Error Reporting (WER)](/windows/desktop/wer/windows-error-reporting):
299
+
Obtain and analyze a dump from [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting):
300
300
301
301
1. Create a folder to hold crash dump files at `c:\dumps`.
302
302
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:
Copy file name to clipboardExpand all lines: aspnetcore/mvc/controllers/actions.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Handle requests with controllers in ASP.NET Core MVC
3
3
author: ardalis
4
4
description: Learn how ASP.NET Core MVC controllers and Actions handle requests and return responses.
5
5
ms.author: tdykstra
6
-
ms.date: 12/05/2019
6
+
ms.date: 04/27/2026
7
7
uid: mvc/controllers/actions
8
8
---
9
9
# Handle requests with controllers in ASP.NET Core MVC
@@ -29,7 +29,7 @@ A controller is an instantiable class, usually [public](/dotnet/csharp/language-
29
29
30
30
A controller class must not have an associated `[NonController]` attribute.
31
31
32
-
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.
32
+
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.
33
33
34
34
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.
35
35
@@ -43,7 +43,7 @@ Public methods on a controller, except those with the `[NonAction]` attribute, a
43
43
44
44
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.
45
45
46
-
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*.
46
+
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*.
47
47
48
48
### Controller Helper Methods
49
49
@@ -73,12 +73,12 @@ There are two result types within this category: [View](xref:mvc/views/overview)
73
73
74
74
***View**
75
75
76
-
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.
76
+
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.
77
77
78
78
***Formatted Response**
79
79
80
80
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.
81
-
81
+
82
82
Other common methods of this type include `File` and `PhysicalFile`. For example, `return PhysicalFile(customerFilePath, "text/xml");` returns <xref:Microsoft.AspNetCore.Mvc.PhysicalFileResult>.
83
83
84
84
#### 3. Methods resulting in a non-empty response body formatted in a content type negotiated with the client
@@ -94,6 +94,7 @@ Applications typically share parts of their workflow. Examples include an app th
94
94
Most filter attributes, such as `[Authorize]`, can be applied at the controller or action level depending upon the desired level of granularity.
95
95
96
96
Error handling and response caching are often cross-cutting concerns:
0 commit comments