Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

This operation requires IIS integrated pipeline mode. AntiForgeryToken

Tags:

c#

.net

iis-7

I'm running IIS7, .NET 4.5 and have a site that is MVC2.

I'm getting the error "This operation requires IIS integrated pipeline mode." when I navigate to a page (an aspx View) with a form on it with an AntiForgeryToken on it.

<%=Html.AntiForgeryToken() %>

I've searched around and seen the AddHeaders solution that fixes this error for other people (who are running IIS6) but I can't see how that would be similar.

The reason I mention the AntiForgeryToken, is because if I take that line out, the page works!

EDIT: I've tried reinstalling .NET 4.5 - didn't help

EDIT: My AppPool is definitely set to "Integrated" Managed Pipeline Mode (ApplicationPoolIdentity). It's the only app in this app pool.

like image 307
Matt Kemp Avatar asked Dec 30 '25 10:12

Matt Kemp


2 Answers

Run the application in IIS Express. This solved the same issue to me. Just right click your project and choose "properties" and click "Web" tab, there under servers click "use localIIS web server and click "USE IIS express"

like image 123
vidya Avatar answered Jan 01 '26 22:01

vidya


Upgrading to MVC3 using the upgrade tool has fixed the problem http://blogs.msdn.com/b/marcinon/archive/2011/01/13/mvc-3-project-upgrade-tool.aspx?Redirected=true

I realise this isn't always a viable fix for everyone - so will leave this question open, hopefully someone else has an idea on fixing the MVC2 solution.

like image 42
Matt Kemp Avatar answered Jan 02 '26 00:01

Matt Kemp