diff --git a/src/Microsoft.TestPlatform.Common/Constants.cs b/src/Microsoft.TestPlatform.Common/Constants.cs
index 93a6988e5a..9f86b7f26b 100644
--- a/src/Microsoft.TestPlatform.Common/Constants.cs
+++ b/src/Microsoft.TestPlatform.Common/Constants.cs
@@ -12,7 +12,7 @@ public static class TestPlatformDefaults
/// string in the vstest.console.exe.config that specifies the bound on no of jobs in the job queue.
///
public const string MaxNumberOfEventsLoggerEventQueueCanHold = "MaxNumberOfEventsLoggerEventQueueCanHold";
-
+
///
/// Default bound on the job queue.
///
diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs
index 8aed93ac90..af000b0ec9 100644
--- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs
+++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs
@@ -7,14 +7,18 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
+ using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
-
+ using System.Xml;
using Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.Utilities;
+ using Microsoft.VisualStudio.TestPlatform.Common.Logging;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers;
using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces;
+ using CommonResources = Microsoft.VisualStudio.TestPlatform.Common.Resources.Resources;
///
/// Discovers test extensions in a directory.
@@ -23,6 +27,8 @@ internal class TestPluginDiscoverer
{
private IFileHelper fileHelper;
+ private static List UnloadableFiles = new List();
+
///
/// Initializes a new instance of the class.
///
@@ -128,6 +134,10 @@ private void GetTestExtensionsFromFiles(
// Scan each of the files for data extensions.
foreach (var file in files)
{
+ if (UnloadableFiles.Contains(file))
+ {
+ continue;
+ }
try
{
Assembly assembly = null;
@@ -138,10 +148,16 @@ private void GetTestExtensionsFromFiles(
this.GetTestExtensionsFromAssembly(assembly, pluginInfos);
}
}
+ catch (FileLoadException e)
+ {
+ EqtTrace.Warning("TestPluginDiscoverer-FileLoadException: Failed to load extensions from file '{0}'. Skipping test extension scan for this file. Error: {1}", file, e);
+ string fileLoadErrorMessage = string.Format(CultureInfo.CurrentUICulture, CommonResources.FailedToLoadAdapaterFile, file);
+ TestSessionMessageLogger.Instance.SendMessage(TestMessageLevel.Warning, fileLoadErrorMessage);
+ UnloadableFiles.Add(file);
+ }
catch (Exception e)
{
EqtTrace.Warning("TestPluginDiscoverer: Failed to load extensions from file '{0}'. Skipping test extension scan for this file. Error: {1}", file, e);
- continue;
}
}
}
@@ -161,8 +177,8 @@ private void GetTestExtensionsFromAssembly(Assembly ass
{
Debug.Assert(assembly != null, "null assembly");
Debug.Assert(pluginInfos != null, "null pluginInfos");
-
Type[] types;
+
try
{
types = assembly.GetTypes();
@@ -178,7 +194,6 @@ private void GetTestExtensionsFromAssembly(Assembly ass
EqtTrace.Warning("LoaderExceptions: {0}", ex);
}
}
-
return;
}
diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IDiscoveryManager.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IDiscoveryManager.cs
index 400a1eb27d..e60787a968 100644
--- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IDiscoveryManager.cs
+++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IDiscoveryManager.cs
@@ -16,7 +16,7 @@ public interface IDiscoveryManager
/// Initializes the discovery manager.
///
/// The path to additional extensions.
- void Initialize(IEnumerable pathToAdditionalExtensions);
+ void Initialize(IEnumerable pathToAdditionalExtensions, ITestDiscoveryEventsHandler2 eventHandler);
///
/// Discovers tests
diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs
index 2576e5154f..7828159fca 100644
--- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs
+++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/TesthostProtocol/IExecutionManager.cs
@@ -18,7 +18,7 @@ public interface IExecutionManager
/// Initializes the execution manager.
///
/// The path to additional extensions.
- void Initialize(IEnumerable pathToAdditionalExtensions);
+ void Initialize(IEnumerable pathToAdditionalExtensions, ITestMessageEventHandler testMessageEventsHandler);
///
/// Starts the test run with sources.
diff --git a/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs b/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs
index 8dfb3feae7..08e4897357 100644
--- a/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs
+++ b/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs
@@ -10,7 +10,6 @@
namespace Microsoft.VisualStudio.TestPlatform.Common.Resources {
using System;
- using System.Reflection;
///
@@ -20,7 +19,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.Resources {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -40,7 +39,7 @@ internal Resources() {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.VisualStudio.TestPlatform.Common.Resources.Resources", typeof(Resources).GetTypeInfo().Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.VisualStudio.TestPlatform.Common.Resources.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -169,6 +168,15 @@ internal static string FailedToFindInstalledUnitTestExtensions {
}
}
+ ///
+ /// Looks up a localized string similar to Failed to load extensions from file '{0}'. Please use /diag for more information..
+ ///
+ internal static string FailedToLoadAdapaterFile {
+ get {
+ return ResourceManager.GetString("FailedToLoadAdapaterFile", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to An error occured while creating Fast filter..
///
diff --git a/src/Microsoft.TestPlatform.Common/Resources/Resources.resx b/src/Microsoft.TestPlatform.Common/Resources/Resources.resx
index 450bf809c0..8e03b8fcdb 100644
--- a/src/Microsoft.TestPlatform.Common/Resources/Resources.resx
+++ b/src/Microsoft.TestPlatform.Common/Resources/Resources.resx
@@ -153,6 +153,9 @@
Failed to find the list of installed unit test extensions. Reason: {0}
+
+ Failed to load extensions from file '{0}'. Please use /diag for more information.
+
An error occured while creating Fast filter.
diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf
index 66ef328d0b..66e157470b 100644
--- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf
+++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf
@@ -269,6 +269,11 @@
Operace se ruší na základě žádosti.
+
+
+ TestPluginDiscoverer: Failed to load extensions from file '{0}'. Please use /diag for more information.
+
+