Skip to content

Commit 50805c3

Browse files
authored
Merge pull request microsoft#35 from codito/dotnetcore
Address PR feedback for microsoft#18
2 parents f35c492 + 2d00aab commit 50805c3

File tree

6 files changed

+21
-25
lines changed

6 files changed

+21
-25
lines changed

src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs

+16-17
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework
1414
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
1515
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;
1616
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
17+
#if !NET46
18+
using System.Runtime.Loader;
19+
#endif
1720

1821
/// <summary>
1922
/// Discovers test extensions in a directory.
2023
/// </summary>
2124
internal class TestPluginDiscoverer
2225
{
2326
#region Fields
24-
27+
2528
#if WINDOWS_UAP
2629
private static HashSet<string> platformAssemblies = new HashSet<string>(new string[] {
2730
"MICROSOFT.VISUALSTUDIO.TESTPLATFORM.UNITTESTFRAMEWORK.DLL",
@@ -53,22 +56,14 @@ public TestExtensions GetTestExtensionsInformation(
5356
bool loadOnlyWellKnownExtensions)
5457
{
5558
Debug.Assert(pathToExtensions != null);
56-
59+
5760
var testExtensions = new TestExtensions
58-
{
59-
TestDiscoverers =
60-
new Dictionary<string, TestDiscovererPluginInformation>(
61-
StringComparer.OrdinalIgnoreCase),
62-
TestExecutors =
63-
new Dictionary<string, TestExecutorPluginInformation>(
64-
StringComparer.OrdinalIgnoreCase),
65-
TestSettingsProviders =
66-
new Dictionary <string, TestSettingsProviderPluginInformation>(
67-
StringComparer.OrdinalIgnoreCase),
68-
TestLoggers =
69-
new Dictionary<string, TestLoggerPluginInformation>(
70-
StringComparer.OrdinalIgnoreCase)
71-
};
61+
{
62+
TestDiscoverers = new Dictionary<string, TestDiscovererPluginInformation>(StringComparer.OrdinalIgnoreCase),
63+
TestExecutors = new Dictionary<string, TestExecutorPluginInformation>(StringComparer.OrdinalIgnoreCase),
64+
TestSettingsProviders = new Dictionary<string, TestSettingsProviderPluginInformation>(StringComparer.OrdinalIgnoreCase),
65+
TestLoggers = new Dictionary<string, TestLoggerPluginInformation>(StringComparer.OrdinalIgnoreCase)
66+
};
7267

7368

7469
#if !WINDOWS_UAP
@@ -165,8 +160,12 @@ private void GetTestExtensionsFromFiles(
165160
try
166161
{
167162
var assemblyName = Path.GetFileNameWithoutExtension(file);
163+
#if NET46
168164
assembly = Assembly.Load(new AssemblyName(assemblyName));
169-
165+
#else
166+
assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(file);
167+
#endif
168+
170169
// Check whether this assembly is known or not.
171170
//if (loadOnlyWellKnownExtensions && assembly != null)
172171
//{

src/datacollector.x86/project.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"netcoreapp1.0": {
2525
"imports": [
2626
"dnxcore50",
27-
"netstandardapp1.5",
27+
"netstandardapp1.0",
2828
"portable-net45+win8",
2929
"portable-net45+wp80+win8+wpa81+dnxcore50"
3030
],
@@ -38,4 +38,4 @@
3838
},
3939
"net46": {}
4040
}
41-
}
41+
}

src/datacollector/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"netcoreapp1.0": {
3030
"imports": [
3131
"dnxcore50",
32-
"netstandardapp1.5",
32+
"netstandardapp1.0",
3333
"portable-net45+win8",
3434
"portable-net45+wp80+win8+wpa81+dnxcore50"
3535
],

src/testhost.x86/Program.cs

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
namespace Microsoft.VisualStudio.TestPlatform.TestHost
44
{
55
using System;
6-
using System.Collections.Generic;
7-
using System.Linq;
8-
using System.Net.Sockets;
96

107
using CrossPlatEngine;
118

src/testhost.x86/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"netcoreapp1.0": {
2525
"imports": [
2626
"dnxcore50",
27-
"netstandardapp1.5",
27+
"netstandardapp1.0",
2828
"portable-net45+win8",
2929
"portable-net45+wp80+win8+wpa81+dnxcore50"
3030
],

src/testhost/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"netcoreapp1.0": {
2727
"imports": [
2828
"dnxcore50",
29-
"netstandardapp1.5",
29+
"netstandardapp1.0",
3030
"portable-net45+win8",
3131
"portable-net45+wp80+win8+wpa81+dnxcore50"
3232
],

0 commit comments

Comments
 (0)