4

As in title: the console app crashes while executing following line

disco = await DiscoveryClient.GetAsync("http://localhost:5000");

No exception thrown, even when I wrap it in try catch debug just brokes on the line; no related info in Output. Visual Studio just stops debuging the app and returns to edit mode.

Has anyone met with something similar? :( What can I try to do?

I'm using VS2015, console app is a .NETCoreApp v1.0, uses "IdentityModel": "2.0.0-rc6";. Identity Server 4 runs on localhost:5000, .NETCoreApp v1.0.

Invoking GetAsync method with https://demo.identityserver.io parameter results in error descripted as well.

I'm following this tutorial: https://identityserver4.readthedocs.io/en/dev/quickstarts/1_client_credentials.html

ignacy130
  • 322
  • 1
  • 2
  • 17
  • use fiddler and see what response http://localhost:5000 is giving you (if any). async is async, and won't trigger a try/catch normally; http://stackoverflow.com/questions/19865523/why-cant-i-catch-an-exception-from-async-code – zerohero Oct 07 '16 at 06:56
  • localhost:5000 works properly when requested with fiddler and chrome, returns json while navigated to /.well-known... just like in the tutorial I updated original post with. I turned off just my code, but with the same result. Also I've wrapped in in try catch so there should be something: http://stackoverflow.com/questions/5383310/catch-an-exception-thrown-by-an-async-method – ignacy130 Oct 07 '16 at 07:10
  • Don't request it will fiddler or chrome, use fiddler to monitor your application's attempt at requesting it (if at all) – zerohero Oct 07 '16 at 08:07
  • Thanks. I tried it. I used View on IdentityServer. I could request .well-known without issues via browser. Next, I ran ConsoleApp to test it and again app crashed on the line. Fiddler just showed a bunch of 201 and 202 results with anonymous jsons from vshub. Did I miss something or misused the tool? – ignacy130 Oct 07 '16 at 08:18

1 Answers1

1

Actually it was working, but I misused async/await calling in Console App. How to do it properly is explanied here: Debugger stops after async HttpClient.GetAsync() call in visual studio

Community
  • 1
  • 1
ignacy130
  • 322
  • 1
  • 2
  • 17