我无法在signalR中创建hubConnection [英] I can't make a hubConnection in signalR

查看:1826
本文介绍了我无法在signalR中创建hubConnection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个如下所示的服务器代码和下面的客户端代码。在客户端代码中,我尝试启动HubConnection但是当我在

I have a server code as shown below and client code further below. In the Client code I am trying to start a HubConnection but I keep getting an System.AggregateException when I include .Wait() on

connection.Start()







namespace SignalRServer
{
    public class Program
    {
        static void Main(string[] args)
        {
            string url = "http://localhost:8080";

            using (WebApp.Start<StartUp>(url))
            {
                Console.WriteLine("Server running on {0}", url);
                Console.ReadLine();
            } 
        }
    }
    class StartUp
    {
        public void Configuration(IAppBuilder app)
        {
            app.MapSignalR();
        }
    }

}





我的客户代码



My Client Code

var connection = new HubConnection("http://localhost:8080");
            var my_hub = connection.CreateHubProxy("ChatHub");

            connection.Start().Wait();

推荐答案

我遇到同样的问题。你有什么解决方案吗?
I have a same problem. Have you any solution?


这篇关于我无法在signalR中创建hubConnection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆