diff --git a/global.json b/global.json index c0b5ed76..3231119b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.101", + "version": "7.0.200", "rollForward": "latestFeature" }, "msbuild-sdks": { diff --git a/src/Microsoft.Kusto.ServiceLayer/HostLoader.cs b/src/Microsoft.Kusto.ServiceLayer/HostLoader.cs index 8b08e85c..2bff5e67 100644 --- a/src/Microsoft.Kusto.ServiceLayer/HostLoader.cs +++ b/src/Microsoft.Kusto.ServiceLayer/HostLoader.cs @@ -52,7 +52,7 @@ namespace Microsoft.Kusto.ServiceLayer // Start the service only after all request handlers are setup. This is vital // as otherwise the Initialize event can be lost - it's processed and discarded before the handler // is hooked up to receive the message - serviceHost.Start().Wait(); + serviceHost.Start().GetAwaiter().GetResult(); isLoaded = true; } } diff --git a/src/Microsoft.SqlTools.Credentials/HostLoader.cs b/src/Microsoft.SqlTools.Credentials/HostLoader.cs index 6753e7f2..796f5096 100644 --- a/src/Microsoft.SqlTools.Credentials/HostLoader.cs +++ b/src/Microsoft.SqlTools.Credentials/HostLoader.cs @@ -34,7 +34,7 @@ namespace Microsoft.SqlTools.Credentials.Utility // Start the service only after all request handlers are setup. This is vital // as otherwise the Initialize event can be lost - it's processed and discarded before the handler // is hooked up to receive the message - serviceHost.Start().Wait(); + serviceHost.Start().GetAwaiter().GetResult(); isLoaded = true; } } diff --git a/src/Microsoft.SqlTools.Hosting/Extensibility/ExtensionServiceHost.cs b/src/Microsoft.SqlTools.Hosting/Extensibility/ExtensionServiceHost.cs index 9ffb8fcd..d19a8062 100644 --- a/src/Microsoft.SqlTools.Hosting/Extensibility/ExtensionServiceHost.cs +++ b/src/Microsoft.SqlTools.Hosting/Extensibility/ExtensionServiceHost.cs @@ -38,7 +38,7 @@ namespace Microsoft.SqlTools.Extensibility // Start the service only after all request handlers are setup. This is vital // as otherwise the Initialize event can be lost - it's processed and discarded before the handler // is hooked up to receive the message - this.Start().Wait(); + this.Start().GetAwaiter().GetResult(); isLoaded = true; } diff --git a/src/Microsoft.SqlTools.Hosting/Hosting/Protocol/MessageDispatcher.cs b/src/Microsoft.SqlTools.Hosting/Hosting/Protocol/MessageDispatcher.cs index 7f1b9eb4..0c1d3530 100644 --- a/src/Microsoft.SqlTools.Hosting/Hosting/Protocol/MessageDispatcher.cs +++ b/src/Microsoft.SqlTools.Hosting/Hosting/Protocol/MessageDispatcher.cs @@ -353,7 +353,7 @@ namespace Microsoft.SqlTools.Hosting.Protocol } catch (Exception e) { - if (!(e is AggregateException && ((AggregateException)e).InnerExceptions[0] is TaskCanceledException)) + if (!(e is AggregateException exception && exception.InnerExceptions[0] is TaskCanceledException)) { // Log the error but don't rethrow it to prevent any errors in the handler from crashing the service Logger.Write(TraceEventType.Error, string.Format("An unexpected error occurred in the request handler: {0}", e.ToString())); diff --git a/src/Microsoft.SqlTools.ResourceProvider/ResourceProviderHostLoader.cs b/src/Microsoft.SqlTools.ResourceProvider/ResourceProviderHostLoader.cs index a5859c4b..75af2193 100644 --- a/src/Microsoft.SqlTools.ResourceProvider/ResourceProviderHostLoader.cs +++ b/src/Microsoft.SqlTools.ResourceProvider/ResourceProviderHostLoader.cs @@ -38,7 +38,7 @@ namespace Microsoft.SqlTools.ResourceProvider // Start the service only after all request handlers are setup. This is vital // as otherwise the Initialize event can be lost - it's processed and discarded before the handler // is hooked up to receive the message - serviceHost.Start().Wait(); + serviceHost.Start().GetAwaiter().GetResult(); isLoaded = true; } } diff --git a/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs b/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs index 58e0a65b..539b82fb 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs @@ -68,7 +68,7 @@ namespace Microsoft.SqlTools.ServiceLayer // Start the service only after all request handlers are setup. This is vital // as otherwise the Initialize event can be lost - it's processed and discarded before the handler // is hooked up to receive the message - serviceHost.Start().Wait(); + serviceHost.Start().GetAwaiter().GetResult(); isLoaded = true; } }