Skip to content

Html.ActionLink() returns incorrect URL when Minimal Action with Name metadata in use  #35592

@martincostello

Description

@martincostello

Describe the bug

If MVC and Minimal Actions are used together when an action has WithName() associated with it, links generated by Html.ActionLink() return the wrong URL.

In the below repo that replicates this issue, when a MapGet() minimal API is added that has name metadata added using WithName("Foo"), links generated using ActionLink() are for endpoint mapped, rather than the intended MVC action.

To Reproduce

Clone the repo here and follow the instructions in the README: https://github.com/martincostello/MvcLinkGenerationRepro

Further technical details

.NET SDK: 6.0.100-rc.1.21420.39
ASP.NET Core: 6.0.0-rc.1.21420.16

Metadata

Metadata

Assignees

Labels

Priority:0Work that we can't release withoutarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcbugThis issue describes a behavior which is not expected - a bug.feature-minimal-actionsController-like actions for endpoint routingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions