解决 ASP.net MVC2 中的“此操作需要 IIS 集成管道模式”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5010201/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 15:16:01  来源:igfitidea点击:

Resolving "this operation requires IIS integration pipeline mode" in ASP.net MVC2

.netasp.net-mvc-2downloadiis-7.5notimplementedexception

提问by Krauzzer

I'm developing an ASP.net MVC2 application, and implement an export to .csv controller action, but when I add the headers to force the download, The following appears in the debugger:

我正在开发 ASP.net MVC2 应用程序,并实现导出到 .csv 控制器操作,但是当我添加标头以强制下载时,调试器中会出现以下内容:

"this operation requires IIS integration pipeline mode"

“此操作需要IIS集成管道模式”

I have searched on numerouse sites with Google, but have yet to resolve this. I am using:

我用谷歌搜索了很多网站,但还没有解决这个问题。我在用:

  • IIS 7.5
  • Windows 7 Ultimate and
  • .Net Framework 4.0,
  • IIS 7.5
  • Windows 7 旗舰版和
  • .Net 框架 4.0,

The application pools for ASP.net are configured in integrated pipeline mode, as I don't understand the problem.

ASP.net 的应用程序池配置为集成管道模式,因为我不明白这个问题。

Can the community assist me solving this and explaining the error to me?

社区可以帮助我解决这个问题并向我解释错误吗?

回答by TommyGunn32

http://devproj20.blogspot.com/2008/02/this-operation-requires-iis-integrated.html

http://devproj20.blogspot.com/2008/02/this-operation-requires-iis-integrated.html

"You can work around this problem by adding your header this way instead:"

“您可以通过以这种方式添加标题来解决此问题:”

Response.AddHeader("myHeader", "someValue");

Response.AddHeader("myHeader", "someValue");

回答by Ravikumar pinni

Go to Project Project properties (right click on project) and go to web tab on left side and check the property use Local IIS Web Server. enter image description here

转到项目项目属性(右键单击项目)并转到左侧的 web 选项卡并检查属性使用本地 IIS Web 服务器。 在此处输入图片说明