2016-03-22 8 views
0

私はこのチュートリアル(http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr-and-mvc)からappを作成しても問題ありません。SignalR 2 MVC 5 NTLM

しかし、今ではNTLMを使い、最初の実行時にウェブサイトを開始したいが、$ .connection.CommunicationsHubにはnullがある。 // CommunicationsHubは私のハブの名前です

次に私が解決策を実行すると、Webブラウザに「ホスト待ち」というメッセージが表示され、終日待機することができます。

Microsoft EdgeとFirefoxでAppを実行します。 スタートアップクラス:

[assembly: OwinStartup(typeof(ASPMVC.Startup.Startup))] 

namespace ASPMVC.Startup 
{ 
    public partial class Startup 
    { 
     public void Configuration(IAppBuilder app) 
     { 
     Debug.WriteLine("----------> Startup Configuration"); 
     app.MapSignalR(); 

     } 

    } 

} (パス:ルート/ハブ/ CommunicationsHub.cs) ハブCLAASは、チュートリアルでのように行いますカスタムあなたのハブに名前を追加する

namespace ASPMVC.Hubs 
{ 
    public class CommunicationsHub : Hub 
    { 
     public void Send(string name, string message) 
     { 
     Debug.WriteLine("---------->"+name); 
     //Call the addNewMessageToPage method to update clients. 
     Clients.All.addNewMessageToPage(name, message); 
     } 
    } 
} 

答えて

0

てみましたか?

namespace ASPMVC.Hubs 
{ 
    [HubName("CommunicationsHub")] 
    public class CommunicationsHub : Hub 
    { 
     public void Send(string name, string message) 
     { 
     Debug.WriteLine("---------->"+name); 
     //Call the addNewMessageToPage method to update clients. 
     Clients.All.addNewMessageToPage(name, message); 
     } 
    } 
} 
+0

私は今、試してみてはいけません....まだlocalhostを待っています – Mateusz