0

I have this AspNetCore application that runs ok under VS2019. Listens correctly on 5001 and all.

But when I try to run it from bin\Debug\necoreapp3.1 folder from command line using

dotnet mywebapp.dll

it goes up normally (stating that it is correctly listening on 5000 and 5001 ports with the correct content path root) as if it was executed from VS2019:

info: WorkflowCore.Services.WorkflowHost[0]
      Starting background tasks
info: WorkflowCore.Services.BackgroundTasks.RunnablePoller[0]
      Polling for runnable workflows
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\work\mywebapp
info: WorkflowCore.Services.BackgroundTasks.RunnablePoller[0]

but when I try to connect to https://localhost:5001 via browser it is unable to connect.

after a while this log appears in the output:

warn: Microsoft.AspNetCore.Server.Kestrel[22]
      Heartbeat took longer than "00:00:01" at "09/01/2021 11:02:44 +00:00". This could be caused by thread pool starvation.

Anybody can help me?

Thanks in advance. P.

  • Just for ensure.. aren't you selecting the text in console? selecting a text in console cause the thread to stop/pause, and you need to hit enter to run again – Leo Sep 01 '21 at 11:29
  • hi Leo, yes I'm sure. I do not click in the console output (ie. to select the url). It stays clear. – Patrick Bateman Sep 01 '21 at 11:33
  • Is The behavior of running `dotnet run` from project folder, instead of bin, the same? – Leo Sep 01 '21 at 11:36
  • same behavior for ```dotnet run```. It seems working only by executing it under VS2019. – Patrick Bateman Sep 01 '21 at 11:39
  • I suppose you tried connecting with http in stead of https? – Svein Terje Gaup Sep 01 '21 at 11:53
  • no i try connecting to ```https://localhost:5001``` – Patrick Bateman Sep 01 '21 at 11:55
  • Ok, so maybe you should try with http? – Svein Terje Gaup Sep 01 '21 at 11:56
  • Quick check: open appsettings.json and change logging to "Debug" for everything re-run application and attempt connection to `https://localhost:5001` .. you should expect some noise while components explain what is happening with the incoming connection. If you do not see any incoming connection, then look at firewall settings, sometimes desktop firewalls get unhappy. If you see incoming connection then please post the logs here so we may be able to help. Also try something simple like `curl` with `--verbose` option for the client instead of the browser. Logs from `curl` would be helpful too. – chkdsk Sep 01 '21 at 11:58
  • @chkdsk changing log level has not changed a thing. I cannot see any debug line in output but still "info" lines. Disabled Windows Firewall, still no luck. Connecting to http on the 5000 port has the same behavior. – Patrick Bateman Sep 01 '21 at 12:04
  • @PatrickBateman about the log, try to change appsettings.Development.json (if exists), and change the properties `Microsoft` and `Microsoft.Hosting.Lifetime` (again, if exists) to `Debug`. After this to to test what @chkdsk said before. – Leo Sep 01 '21 at 13:58
  • I did on all the JSON files. Setting everything to ```Debug``` : ```"Logging": { "LogLevel": { "Default": "Debug", "Microsoft": "Debug", "Microsoft.Hosting.Lifetime": "Debug", "*": "Debug" } }``` – Patrick Bateman Sep 01 '21 at 14:38

0 Answers0