Cannot resolve action in ASP.NET Core controller when calling Url.Action()

Answered

1. Create an empty ASP.NET Core Web API project (.NET Core v2, v3, v5 — doesn't matter, reproduces everywhere).
2. Go to the controller and add the following line of code to the Get action:

string selfLink = Url.Action();

"Cannot resolve action 'Get'" error is shown for no reason.

The code works as expected, a proper URL pointing to the current action is generated.

Looks similar to https://resharper-support.jetbrains.com/hc/en-us/community/posts/115000757944-Cannot-resolve-action-with-tag-helper-and-ActionName-attribute but it is stated as "fixed" a while ago.

2 comments
Comment actions Permalink

Hello Vladimir,

Thank you for reporting the issue, I have created a corresponding record on our bug tracker: RSRP-484897. Please upvote it and click on Watch to monitor the progress of the issue.

Have a good day!

0

Please sign in to leave a comment.