我一直在使用SignalR創建簡單的聊天應用程序時,Visual Studio 2013(但應用程序是在2012年),框架4.5。SignalR聊天在IIS7配置不工作時 - Windows 7的
我使用ASP.NET的WebForms只(不MVC)
它,當我通過Visual Studio的運行工作。 但是,當我在IIS中配置它,它給在網頁控制檯下面的錯誤 -
GET http://localhost/chat/signalr/hubs 404 (Not Found) localhost/:30
Uncaught TypeError: Cannot read property 'client' of undefined localhost/chat/:112
「聊天」是虛擬目錄的名稱。
新增FOLL。以及在web.config中 - 從Global.asax.cs-
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
代碼
protected void Application_Start(object sender, EventArgs e)
{
// Register the default hubs route: ~/signalr/hubs
RouteTable.Routes.MapHubs();
}
代碼從index.html的 -
<!--Reference the SignalR library. -->
<script src="Scripts/jquery.signalR-1.0.0.js"></script>
<!--Reference the autogenerated SignalR hub script. -->
<script src="signalr/hubs"></script>
我已經嘗試了這個爲好,但不成功 -
<script src="<%= ResolveUrl("~/signalr/hubs") %>" type="text/javascript"></script>
注 - 我a米提到這個http://www.codeproject.com/Articles/562023/Asp-Net-SignalR-Chat-Room 在此先感謝。
我已經嘗試從以下鏈接的每個解決方案 - https://github.com/SignalR/SignalR/wiki/Faq – Abhi
可能的重複:http://stackoverflow.com/questions/17237037/signalr-fails-on-iis – slfan