Build with .NET 7.0.200 + Async improvements (#1869)

This commit is contained in:
Cheena Malhotra
2023-02-17 09:54:20 -08:00
committed by GitHub
parent 675427c690
commit 86a8861e78
7 changed files with 7 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.101",
"version": "7.0.200",
"rollForward": "latestFeature"
},
"msbuild-sdks": {

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}

View File

@@ -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()));

View File

@@ -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;
}
}

View File

@@ -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;
}
}