I just ran into this problem today and wanted to add my solution for anyone who might run into this error. Nothing else worked for me. I recently made an installer for one of the other projects in this solution, and I had to uncheck the "Build" checkbox in Configuration Manager.
If this is not verified, it was not rebuilt when I added the [Authorize] tag, although I made changes to the cshtml page that were shown. I did not understand this until I set a milestone in my control action and noticed that I had never hit it. I even tried to return null from the controller, and the application still moved to a new page.
So, a short story, make sure you build this project in Configuration Manager, which worked for me.
Alan fitzgerald
source share