MVC Forms LoginUrl is incorrect

This is a known issue. I had the same problem with my custom authorize attribute. I found the solution somewhere on the net, can’t remember where. Just add this to appSettings in your web.config

<add key="loginUrl" value="~/Account/LogOn" />

Note: This works with MVC 3, I didn’t try it with previous versions.

EDIT:
Found it mentioned in release notes, but it seems that they’ve changed the setting name and forgot to update release notes for RTM version.

Leave a Comment