fixed the issue with loading dlls for service provider (#312)

* fixed the issue with loading dlls for service provider
This commit is contained in:
Leila Lali
2017-04-13 15:57:56 -07:00
committed by GitHub
parent d903ba56a9
commit a1bc1bc344
6 changed files with 28 additions and 12 deletions

View File

@@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Composition;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
@@ -24,6 +25,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
/// A Service to support querying server and database information as an Object Explorer tree.
/// The APIs used for this are modeled closely on the VSCode TreeExplorerNodeProvider API.
/// </summary>
[Export(typeof(IHostedService))]
public class ObjectExplorerService : HostedService<ObjectExplorerService>, IComposableService
{
internal const string uriPrefix = "objectexplorer://";
@@ -79,6 +81,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
/// <param name="serviceHost">The service host instance to register with</param>
public override void InitializeService(IProtocolEndpoint serviceHost)
{
Logger.Write(LogLevel.Verbose, "ObjectExplorer service initialized");
this.serviceHost = serviceHost;
// Register handlers for requests
serviceHost.SetRequestHandler(CreateSessionRequest.Type, HandleCreateSessionRequest);
@@ -165,7 +168,16 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
{
// open connection based on request details
ConnectionCompleteParams result = await connectionService.Connect(connectParams);
return result;
if(result != null && !string.IsNullOrEmpty(result.ConnectionId))
{
return result;
}
else
{
await serviceHost.SendEvent(ConnectionCompleteNotification.Type, result);
return null;
}
}
catch (Exception ex)
{