diff --git a/src/vstest.console/Processors/InIsolationArgumentProcessor.cs b/src/vstest.console/Processors/InIsolationArgumentProcessor.cs
new file mode 100644
index 0000000000..de5693ce61
--- /dev/null
+++ b/src/vstest.console/Processors/InIsolationArgumentProcessor.cs
@@ -0,0 +1,116 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+namespace Microsoft.VisualStudio.TestPlatform.CommandLine.Processors
+{
+ using System;
+ using System.Globalization;
+ using Microsoft.VisualStudio.TestPlatform.Utilities;
+ using CommandLineResources = Microsoft.VisualStudio.TestPlatform.CommandLine.Resources.Resources;
+
+ ///
+ /// An argument processor that allows the user to specify whether the execution
+ /// should happen in the current vstest.console.exe process or a new different process.
+ ///
+ internal class InIsolationArgumentProcessor : IArgumentProcessor
+ {
+ #region Constants
+
+ public const string CommandName = "/InIsolation";
+
+ #endregion
+
+ private Lazy metadata;
+
+ private Lazy executor;
+
+ ///
+ /// Gets the metadata.
+ ///
+ public Lazy Metadata
+ {
+ get
+ {
+ if (this.metadata == null)
+ {
+ this.metadata = new Lazy(() => new InIsolationArgumentProcessorCapabilities());
+ }
+
+ return this.metadata;
+ }
+ }
+
+ ///
+ /// Gets or sets the executor.
+ ///
+ public Lazy Executor
+ {
+ get
+ {
+ if (this.executor == null)
+ {
+ this.executor =
+ new Lazy(
+ () =>
+ new InIsolationArgumentExecutor());
+ }
+
+ return this.executor;
+ }
+
+ set
+ {
+ this.executor = value;
+ }
+ }
+ }
+
+ internal class InIsolationArgumentProcessorCapabilities : BaseArgumentProcessorCapabilities
+ {
+ public override string CommandName => InIsolationArgumentProcessor.CommandName;
+
+ public override bool AllowMultiple => false;
+
+ public override bool IsAction => false;
+
+ public override ArgumentProcessorPriority Priority => ArgumentProcessorPriority.Normal;
+
+ public override HelpContentPriority HelpPriority => HelpContentPriority.InIsolationArgumentProcessorHelpPriority;
+ }
+
+ internal class InIsolationArgumentExecutor : IArgumentExecutor
+ {
+ #region Constructors
+ public InIsolationArgumentExecutor()
+ {
+ }
+ #endregion
+
+ #region IArgumentProcessor
+
+ ///
+ /// Initializes with the argument that was provided with the command.
+ ///
+ /// Argument that was provided with the command.
+ public void Initialize(string argument)
+ {
+ if (!string.IsNullOrWhiteSpace(argument))
+ {
+ throw new CommandLineException(
+ string.Format(CultureInfo.CurrentCulture, CommandLineResources.InvalidInIsolationCommand, argument));
+ }
+
+ ConsoleOutput.Instance.WriteLine(CommandLineResources.InIsolationDeprecated, OutputLevel.Information);
+ }
+
+ ///
+ /// Execute.
+ ///
+ public ArgumentProcessorResult Execute()
+ {
+ // Nothing to do since we updated the parameter during initialize parameter
+ return ArgumentProcessorResult.Success;
+ }
+
+ #endregion
+ }
+}
diff --git a/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs b/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs
index 241ab9efbe..754f9c6435 100644
--- a/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs
+++ b/src/vstest.console/Processors/Utilities/ArgumentProcessorFactory.cs
@@ -230,7 +230,8 @@ public IEnumerable GetArgumentProcessorsToAlwaysExecute()
new ParallelArgumentProcessor(),
new EnableDiagArgumentProcessor(),
new CLIRunSettingsArgumentProcessor(),
- new ResultsDirectoryArgumentProcessor()
+ new ResultsDirectoryArgumentProcessor(),
+ new InIsolationArgumentProcessor()
};
///
diff --git a/src/vstest.console/Resources/Resources.Designer.cs b/src/vstest.console/Resources/Resources.Designer.cs
index 0f55d62a8b..bc92446200 100644
--- a/src/vstest.console/Resources/Resources.Designer.cs
+++ b/src/vstest.console/Resources/Resources.Designer.cs
@@ -1449,5 +1449,16 @@ public static string UseVsixExtensionsValueRequired {
return ResourceManager.GetString("UseVsixExtensionsValueRequired", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to The /InIsolation flag is deprecated. The test are always run in a separate process
+ ///
+ public static string InIsolationDeprecated
+ {
+ get
+ {
+ return ResourceManager.GetString("InIsolationDeprecated", resourceCulture);
+ }
+ }
}
}
diff --git a/src/vstest.console/Resources/Resources.resx b/src/vstest.console/Resources/Resources.resx
index 7165b68a1c..f59bed4b42 100644
--- a/src/vstest.console/Resources/Resources.resx
+++ b/src/vstest.console/Resources/Resources.resx
@@ -634,4 +634,7 @@
The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}
+
+ The /InIsolation flag is deprecated. The tests are always run in a separate process
+
\ No newline at end of file
diff --git a/src/vstest.console/Resources/xlf/Resources.cs.xlf b/src/vstest.console/Resources/xlf/Resources.cs.xlf
index ae99dcd7ff..6eefc12f23 100644
--- a/src/vstest.console/Resources/xlf/Resources.cs.xlf
+++ b/src/vstest.console/Resources/xlf/Resources.cs.xlf
@@ -1514,6 +1514,11 @@
The path '{0}' specified in the 'ResultsDirectory' is invalid. Error: {1}
+
+
+ The /InIsolation flag is deprecated. The tests are always run in a separate process
+
+