【发布时间】:2016-03-22 08:30:24
【问题描述】:
我根据本教程 (http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr-and-mvc) 制作了应用程序,它运行良好。
但现在我想使用 NTLM,并在第一次运行网站时启动,但我在 $.connection.CommunicationsHub 中有 null; //CommunicationsHub 是我的集线器的名称
下次我运行解决方案时,网络浏览器的状态为:“等待主机”,我可以等待一整天。
我在 Microsoft Edge 和 Firefox 上运行应用程序。 启动类:
[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) hub 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);
}
}
}
【问题讨论】:
标签: c# asp.net-mvc-5 signalr ntlm