在IIS Express中测试SignalR应用程序

6

大家好,我正在使用Visual Studio 2012,并开发了一个仅供审查目的的简单应用程序。

但是,我卡住了,因为当我尝试预览该应用程序时,我收到以下错误消息:

[PlatformNotSupportedException: This operation requires IIS integrated pipeline mode.]
   System.Web.HttpResponse.get_Headers() +9681446
   System.Web.HttpResponseWrapper.get_Headers() +9
   Microsoft.Owin.Host.SystemWeb.OwinCallContext.CreateEnvironment() +309
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.GetInitialEnvironment(HttpApplication application) +246
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.PrepareInitialContext(HttpApplication application) +15
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.BeginEvent(Object sender, EventArgs e, AsyncCallback cb, Object extradata) +288
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +285
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

有什么想法可以解决这个问题吗?

请确保您正在使用IIS Express而不是开发服务器。 - davidfowl
4个回答

10
在“解决方案资源管理器”下选择您的Web应用程序项目,然后在“属性”窗口中选择“开发服务器” > “托管管道模式” > “集成”。

3
我正在使用Visual Studio 2012。我没有看到这个选项。 - Paul Plato
6
在VS 2012中不可用。因此,您可以通过右键单击项目,选择属性,点击Web选项卡,在服务器部分下选择“使用本地IIS Web服务器”来更改所用的服务器。 - Gianpiero
2
在VS 2012网站(不是应用程序)中,我可以直接右键单击我的项目并选择“使用本地IIS Web服务器”。 - Gabriel GM
谢谢,那很有帮助 :) - Shezi

1
我在Visual Studio 2012(旗舰版)中也找不到那个选项。但是,在“项目属性- >Web”选项卡中将服务器更改为IIS Express对我有用。

编辑:显然,当切换到IIS Express时,该选项变得可用。


0

如果一切都失败了,请查看您的项目中是否有一个vwd.webinfo文件,该文件设置了useClassicPipelineMode。
我以前从未查看过这个文件。 几天前,我只是出于好玩而查看了一下,发现了以下内容:

<VisualWebDeveloper>
    <iisExpressSettings windowsAuthentication="enabled" anonymousAuthentication="disabled" useClassicPipelineMode="true" sslPort="44300"/>
</VisualWebDeveloper>

我改变了"useClassicPipelineMode"的值,我的头痛问题解决了!

0

您的应用程序池处于经典模式,但您的应用程序需要集成模式才能启动。请将其更改为集成模式:

打开 IIS 管理器

选择“应用程序池”

选择运行您的应用程序的池

在右侧面板中选择“基本设置”

管理管道模式更改为“集成”


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接