"This operation requires IIS integrated pipeline mode."
I was having the same issue and I solved it doing the following:
In Visual Studio, select "Project properties".
Select the "Web" Tab.
Select "Use Local IIS Web server".
Check "Use IIS Express"
Your Application Pool is in classic mode but your Application need integrated mode to fire. change it to Integrated Mode:
Open IIS Manager
Application Pool
Select pool that your app are run in it
In right panel select Basic Setting
Manage Pipeline Mode change to Integrated
Try using Response.AddHeader
instead of Response.Headers.Add()