diff --git a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs
index aba69fca5b..e9408978fb 100644
--- a/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs
+++ b/src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs
@@ -47,6 +47,23 @@ public static string GetTestResultsDirectory(RunConfiguration runConfiguration)
return resultsDirectory;
}
+ ///
+ /// Gets the target framework from the run configuration
+ ///
+ /// Test run configuration
+ /// Target Framework
+ public static Framework GetTargetFramework(RunConfiguration runConfiguration)
+ {
+ Framework targetFramework = null;
+ if (runConfiguration != null)
+ {
+ // It will get target framework from runsettings
+ targetFramework = runConfiguration.TargetFramework;
+ }
+
+ return targetFramework;
+ }
+
///
/// Gets the solution directory from run configuration
///
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs
index 9dfad5fb16..c17b898d8f 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/TestLoggerManager.cs
@@ -47,6 +47,11 @@ internal class TestLoggerManager : ITestLoggerManager
///
private string testRunDirectory;
+ ///
+ /// Target framework.
+ ///
+ private string targetFramework;
+
///
/// Test Logger Events instance which will be passed to loggers when they are initialized.
///
@@ -139,6 +144,7 @@ public void Initialize(string runSettings)
// Store test run directory. This runsettings is the final runsettings merging CLI args and runsettings.
this.testRunDirectory = GetResultsDirectory(runSettings);
+ this.targetFramework = GetTargetFramework(runSettings)?.Name;
var loggers = XmlRunSettingsUtilities.GetLoggerRunSettings(runSettings);
@@ -454,6 +460,33 @@ internal string GetResultsDirectory(string runSettings)
return resultsDirectory;
}
+ ///
+ /// Gets the target framework of the test run.
+ ///
+ /// Test run settings.
+ /// Target framework
+ internal Framework GetTargetFramework(string runSettings)
+ {
+ Framework targetFramework = null;
+ if (runSettings != null)
+ {
+ try
+ {
+ RunConfiguration runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(runSettings);
+ targetFramework = RunSettingsUtilities.GetTargetFramework(runConfiguration);
+ }
+ catch (SettingsException se)
+ {
+ if (EqtTrace.IsErrorEnabled)
+ {
+ EqtTrace.Error("TestLoggerManager.GetResultsDirectory: Unable to get the target framework: Error {0}", se);
+ }
+ }
+ }
+
+ return targetFramework;
+ }
+
///
/// Enables sending of events to the loggers which are registered.
///
@@ -582,9 +615,9 @@ private bool InitializeLogger(object logger, string extensionUri, Dictionary UpdateLoggerParameters(Dictionary
@@ -20,7 +19,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Extensions.TrxLogger.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", "4.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 TrxResource {
@@ -40,7 +39,7 @@ internal TrxResource() {
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.Extensions.TrxLogger.Resources.TrxResource", typeof(TrxResource).GetTypeInfo().Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.VisualStudio.TestPlatform.Extensions.TrxLogger.Resources.TrxResource", typeof(TrxResource).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -179,6 +178,15 @@ internal static string MessageForSkippedTests {
}
}
+ ///
+ /// Looks up a localized string similar to The parameters LogFileName and LogFilePrefix cannot be used together. .
+ ///
+ internal static string PrefixAndNameProvidedError {
+ get {
+ return ResourceManager.GetString("PrefixAndNameProvidedError", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Aborted.
///
diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Resources/TrxResource.resx b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Resources/TrxResource.resx
index 9bfad88ae8..b50850a64f 100644
--- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Resources/TrxResource.resx
+++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Resources/TrxResource.resx
@@ -211,4 +211,7 @@ Error Details: {1}:{2}
WARNING: Overwriting results file: {0}
+
+ The parameters LogFileName and LogFilePrefix cannot be used together.
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Resources/xlf/TrxResource.cs.xlf b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Resources/xlf/TrxResource.cs.xlf
index 74c81207aa..17f5cd7028 100644
--- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Resources/xlf/TrxResource.cs.xlf
+++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Resources/xlf/TrxResource.cs.xlf
@@ -298,6 +298,11 @@ Fehlerdetails: {1}: {2}
UPOZORNĚNÍ: Přepíše se soubor výsledků: {0}
+
+ The parameters LogFileName and LogFilePrefix cannot be used together.
+ The parameters LogFileName and LogFilePrefix cannot be given together.
+
+