zoukankan      html  css  js  c++  java
  • 在.net4的环境下使用Microsoft.AspNet.SignalR.Client 2.4.0

    我的环境是运行在.net 4 framework,并且使用了signalr

    在重连的时候发现,运行的服务被关闭了。找不到合适的处理的办法。因为报错是

    说明: 由于未经处理的异常,进程终止。
    异常信息: System.Net.Sockets.SocketException
    在 System.Net.Sockets.Socket.InternalEndConnect(System.IAsyncResult)
    在 System.Net.Sockets.Socket.EndConnect(System.IAsyncResult)
    在 System.Net.ServicePoint.ConnectSocketInternal(Boolean, System.Net.Sockets.Socket, System.Net.Sockets.Socket, System.Net.Sockets.Socket ByRef, System.Net.IPAddress ByRef, ConnectSocketState, System.IAsyncResult, System.Exception ByRef)

    异常信息: System.Net.WebException
    在 System.Runtime.CompilerServices.AsyncServices.<ThrowAsync>b__1(System.Object)
    在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
    在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
    在 System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    在 System.Threading.ThreadPoolWorkQueue.Dispatch()

    https://stackoverflow.com/questions/2456819/how-can-i-set-up-net-unhandledexception-handling-in-a-windows-service

    根据此链接

     最好的方法是尽可能避免在服务控制管理器下进行开发。

    The best approach is to avoid developing under the Service Control Manager as much as you can

    所以把

    await mHubConnection.Start();换成了 mHubConnection.Start();

    一切ok.在.net 4下面使用,需要安装

    Microsoft.Bcl 套件。

  • 相关阅读:
    考研机试 45.skew数
    考研机试 39.大整数因子
    考研机试 37.小白鼠排队
    考研机试 36.中位数
    考研机试 35.最简真分式
    考研机试 30.进制转换
    软工实践第一次作业
    [CF767D] Cartons of milk
    [CF687C] The Values You Can Make
    [CCPC2020绵阳H] Hide and Seek
  • 原文地址:https://www.cnblogs.com/forhell/p/10723539.html
Copyright © 2011-2022 走看看