【问题标题】:SignalR 2 MVC 5 NTLMSignalR 2 MVC 5 NTLM
【发布时间】: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


    【解决方案1】:

    您是否尝试将自定义名称添加到您的中心?

    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);
           }
       }
     }
    

    【讨论】:

      猜你喜欢
      • 2014-09-04
      • 1970-01-01
      • 1970-01-01
      • 2017-05-09
      • 1970-01-01
      • 2021-04-07
      • 2018-02-12
      • 2015-01-07
      • 1970-01-01
      相关资源
      最近更新 更多