4

如标题:控制台应用程序在执行以下行时崩溃

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

没有抛出异常,即使我将它包装在try catch调试中也只是在线中断;输出中没有相关信息。Visual Studio 只是停止调试应用程序并返回到编辑模式。

有没有人遇到过类似的事情?:( 我可以尝试做什么?

我正在使用 VS2015,控制台应用程序是 .NETCoreApp v1.0,使用“IdentityModel”:“2.0.0-rc6”;。Identity Server 4 在 localhost:5000、.NETCoreApp v1.0 上运行。

使用https://demo.identityserver.io参数调用GetAsync方法也会导致错误描述。

我正在关注本教程:https ://identityserver4.readthedocs.io/en/dev/quickstarts/1_client_credentials.html

4

1 回答 1

1

实际上它正在工作,但我在控制台应用程序中滥用了 async/await 调用。此处解释了如何正确执行此操作:调试器在 Visual Studio 中的异步 HttpClient.GetAsync() 调用后停止

于 2016-10-07T09:12:26.537 回答