in

Platinum Bay

Peace, Love, and...

This Blog

Syndication


.NETicated

This operation requires IIS integrated pipeline mode

I’ve been working on a few ASP.NET MVC demos recently, one of which uses a custom ActionResult to send an iCal file back to the user. As part of the custom ActionResult I add a Content-Disposition header to the reply so the user is prompted to download the file.

When I went to test the code in the browser however (Ctrl+F5), I received a “This operation requires IIS integrated pipeline mode” exception. What makes this particularly interesting is that I am not running in IIS, but rather the out-of-the-box ASP.NET Development Server that comes with Visual Studio so I don’t have control over the “pipeline mode”. Initially searching didn’t turn up anything helpful either.

It turns out that the answer is really quick and easy; simply change:

response.Headers.Add(…)

to

response.AddHeader(…)
Published Oct 07 2010, 09:37 PM by Steve
Filed under: , ,

Comments

October 8, 2010 12:03 PM

Pingback from  Dew Drop – October 8, 2010 | Alvin Ashcraft's Morning Dew

 

October 9, 2010 12:14 AM

kick it

Dude
 

October 23, 2010 7:44 PM

Pingback from  Quickie: ASP.NET MVC, custom ActionResult and “This operation requires IIS integrated pipeline mode” while adding headers. « juarola's notes

 

December 28, 2011 6:25 PM

It's worth noting that using the AddHeader() method sends both the original and the new header.

This hasn't been a problem until the recent release of Chrome 16 which throws an error when it receives duplicate headers (presumably as a security feature).

 

September 15, 2012 11:08 AM

Hi, I too am getting this error while downloading a remote file from server, using .net4.0 and IIS 5.1. I am using AddHeader method, still no use. Can you give any clue if some thing else can fix this? Thanks.

Gauri
 

Leave a Comment

(required )  
(optional )
(required )  
Add

About Steve

Steve Andrews is an independent consultant, INETA speaker, and Microsoft MVP for Visual Studio ALM. He has been working in technology for over ten years focusing on custom application development and Application Lifecycle Management. Steve is also Microsoft and IBM certified and a community fanatic having led sessions at nearly 100 events across North America. When he's not developing software solutions or engaging with the community about software technology, Steve is a closet singer and songwriter and plays the guitar and keys. Occasionally, Steve even gets to sleep. Occasionally.
Powered by Community Server (Commercial Edition), by Telligent Systems
© Platinum Bay | Some Rights Reserved Creative Commons License

Disclaimer: The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or annonymous comments) - so keep it polite, please.