ASP.NET CORE 2.1调试时服务器超时 [英] ASP.NET CORE 2.1 Server timeout while debugging

查看:359
本文介绍了ASP.NET CORE 2.1调试时服务器超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

'错误:服务器超时时间未收到来自服务器的消息 服务器."

我正在尝试调试一些服务器端代码,而这样做的同时,客户端在不到一分钟的时间内就断开了连接.

我仅使用SignalR与客户端通信,而没有控制器.

是否有任何设置可以禁用超时或至少使其比现在更长的时间?

我的launchSettings.json:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:26793",
      "sslPort": 44386
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "ASPNETCORE_HTTPS_PORT": "44386"
      }
    },
    "Api": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "ASPNETCORE_URLS": "https://localhost:5001;http://localhost:5000"
      }
    }
  }
}

解决方案

感谢 @Arhire Ionut

以下是增加Javascript客户端超时的方法

hubConnection.serverTimeoutInMilliseconds = 100000; // 100 second

此处有更多详细信息=> https://github.com/aspnet/Docs/issues/6885

'Error: Server timeout elapsed without receiving a message from the server.'.

I'm trying to debug some server-side code and while I do that the client gets disconnected in less than a minute.

I'm only using SignalR to communicate to clients, without controllers yet.

Is there any setting that can disable timeout or at least make it way longer than it is now?

my launchSettings.json:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:26793",
      "sslPort": 44386
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "ASPNETCORE_HTTPS_PORT": "44386"
      }
    },
    "Api": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "ASPNETCORE_URLS": "https://localhost:5001;http://localhost:5000"
      }
    }
  }
}

解决方案

Thanks to @Arhire Ionut

Here is how to increase Javascript client timeout

hubConnection.serverTimeoutInMilliseconds = 100000; // 100 second

More details here => https://github.com/aspnet/Docs/issues/6885

这篇关于ASP.NET CORE 2.1调试时服务器超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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