From 034075d584a77aa75a542e16f1eeb6c118cfc164 Mon Sep 17 00:00:00 2001 From: RogueException Date: Mon, 18 Jan 2016 04:56:19 -0400 Subject: [PATCH] Removed AsyncContext in ExecuteAndWait --- src/Discord.Net/DiscordClient.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Discord.Net/DiscordClient.cs b/src/Discord.Net/DiscordClient.cs index a2fe85afd..ba442d058 100644 --- a/src/Discord.Net/DiscordClient.cs +++ b/src/Discord.Net/DiscordClient.cs @@ -1043,11 +1043,7 @@ namespace Discord /// Blocking call that will execute the provided async method and wait until client has been manually stopped. This is mainly intended for use in console applications. public void ExecuteAndWait(Func asyncAction) { - try - { - AsyncContext.Run(asyncAction); - } - catch (TaskCanceledException) { } + asyncAction().GetAwaiter().GetResult(); _disconnectedEvent.WaitOne(); } /// Blocking call and wait until client has been manually stopped. This is mainly intended for use in console applications.