asp-action behave differently between ASP.NET Core 2.2 and 3.1 when Action Method has Async suffix #21216
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
Status: Resolved
Milestone
Uh oh!
There was an error while loading. Please reload this page.
While upgrading an application from ASP.NET Core 2.2 to 3.1 I noticed that
asp-action
TagHelper behave differently in these versions.I am not sure this is intentional or not, or whether it was announced as a breaking change or not. Also, not sure if this issue is talking about the same thing or not; in my case, the link is not generated at all.
Describe the bug
In ASP.NET Core 2.2, when using the Action Method name with
asp-action
TagHelper, the link is generated as expected. However, in ASP.NET Core 3.1, no link is generated if the Action Method has Async suffix.For more details, see "To Reproduce" section.
To Reproduce
/Account/Logout
.Repeat the same steps, but now create an ASP.NET Core 3.1. Run the application and see that there is no link generated and the rendered anchor tag is:
Lastly, remove
Async
fromasp-action
TagHelper:Run the application and see that the link is generated as expected.
The text was updated successfully, but these errors were encountered: