我的系统是win2008,iis7.部署webapi后,应用池只能用经典模式。且要添加一个映射:
api/* 指向: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
那为什么集成模式不行呢,微软这么说:
http://www.asp.net/mvc/overview/older-versions-1/deployment/using-asp-net-mvc-with-different-versions-of-iis-cs
它提供两个方案,1、使用文件后缀名,比如 /Product.mvc/Details/3 添加.mvc 或 .aspx等后缀。
2、添加对 * 的映射到asp.net。 (还不知道会不会对静态文件有影响)
总之,我没有测试上面的方法。退一步,还是改成经典模式算了。
SingalR呢,直接要求IIS8.0才支持websocket. 而IIS7不能升级,除非升级系统。
微软说:"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
看到啦,不仅是IIS8,并且是集成模式才行。否则只能用其它方式进行连接了。
彻底打消了我的念头,实在想添加websocket的应用时,还是用socket.io等其它办法吧!