【问题标题】:'System.AggregateException' occurred in mscorlib.dll” when using SignalR使用 SignalR 时在 mscorlib.dll 中发生“System.AggregateException”
【发布时间】:2015-06-04 23:30:38
【问题描述】:

考虑以下代码:

using Microsoft.AspNet.SignalR.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Stock
    {
        public string Symbol { get; set; }
        public decimal Price { get; set; }
    }

    class Program
    {
        static void Main(string[] args)
        {
            var hubConnection = new HubConnection("http://www.contoso.com/");
            IHubProxy stockTickerHubProxy = hubConnection.CreateHubProxy("StockTickerHub");
            stockTickerHubProxy.On<Stock>("UpdateStockPrice", stock => Console.WriteLine("Stock update for {0} new price {1}", stock.Symbol, stock.Price));
            hubConnection.Start().Wait();
            Console.ReadLine();
        }
    }
}

运行时,我收到“在 mscorlib.dll 中发生‘System.AggregateException’类型的未处理异常”。我尝试了这个问题的公认答案,但我不知道如何在那里实际填写表格。如何获取有关此代码示例中出了什么问题的详细信息?这是我的“例外”窗口的样子:

【问题讨论】:

  • Visual Studio 显示一个异常窗口,其中包含指向更多详细信息的链接。您向我们展示的窗口只是您的视觉工作室的设置窗口。

标签: c# .net signalr unhandled-exception


【解决方案1】:

正如 Patrick Eckebrecht 在他对这个问题的评论中指出的那样,单击“查看详细信息”即可找到异常原因:

【讨论】:

    猜你喜欢
    • 2012-06-22
    • 2014-11-15
    • 1970-01-01
    • 1970-01-01
    • 2021-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-08
    相关资源
    最近更新 更多