Fix MEF loader issues with framework assemblies (#253)

This is fixing a crashing bug in previous check-in so I'm pushing in.  Please leave comments on the commit and email if there is feedback.

* Fix MEF loader issues with framework assemblies

* Fix broken test from changed behavior

* Fix braces to C# convention
This commit is contained in:
Karl Burtram
2017-02-23 19:18:43 -08:00
committed by GitHub
parent 206cde9a3e
commit 3516a05f80
2 changed files with 29 additions and 4 deletions

View File

@@ -42,12 +42,12 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Extensibility
}
[Fact]
public void CreateDefaultServiceProviderShouldFindTypesInAllAssemblies()
public void CreateDefaultServiceProviderShouldFindTypesInAllKnownAssemblies()
{
// Given a default ExtensionServiceProvider
// Then should not find exports from a different assembly
// Then we should not find exports from a test assembly
ExtensionServiceProvider serviceProvider = ExtensionServiceProvider.CreateDefaultServiceProvider();
Assert.NotEmpty(serviceProvider.GetServices<MyExportType>());
Assert.Empty(serviceProvider.GetServices<MyExportType>());
// But should find exports that are defined in the main assembly
Assert.NotEmpty(serviceProvider.GetServices<ASTNodeFormatterFactory>());