个人系统是win2008,iis7.部署webapi后,应用池只能用经典模式。且要添加一个映射:web
api/* 指向: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dllapi
那为何集成模式不行呢,微软这么说:websocket
http://www.asp.net/mvc/overview/older-versions-1/deployment/using-asp-net-mvc-with-different-versions-of-iis-csmvc
它提供两个方案,一、使用文件后缀名,好比 /Product.mvc/Details/3 添加.mvc 或 .aspx等后缀。app
二、添加对 * 的映射到asp.net。 (还不知道会不会对静态文件有影响)asp.net
总之,我没有测试上面的方法。退一步,仍是改为经典模式算了。less
SingalR呢,直接要求IIS8.0才支持websocket. 而IIS7不能升级,除非升级系统。socket
微软说:"Note that for SignalR to use WebSockets, Windows Server 2012 or Windows 8 is required"测试
for SignalR to use WebSocket, IIS 8 or IIS 8 Express must be used, the server must be using Windows 8, Windows Server 2012, or later, and WebSocket must be enabled in IIS. For information on how to enable WebSocket in IIS
ui
IIS 8 or IIS 8 Express.
IIS 7 and 7.5. Support for extensionless URLs is required.
IIS must be running in integrated mode; classic mode is not supported. Message delays of up to 30 seconds may be experienced if IIS is run in classic mode using the Server-Sent Events transport.
The hosting application must be running in full trust mode.
看到啦,不只是IIS8,而且是集成模式才行。不然只能用其它方式进行链接了。
完全打消了个人念头,实在想添加websocket的应用时,仍是用socket.io等其它办法吧!