diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/PlatformEqtTrace.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/PlatformEqtTrace.cs index 9813efc3e7..43162608f2 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/PlatformEqtTrace.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/PlatformEqtTrace.cs @@ -64,7 +64,17 @@ public void WriteLine(PlatformTraceLevel level, string message) /// public bool InitializeVerboseTrace(string customLogFile) { - LogFile = Path.GetTempPath() + Path.GetFileNameWithoutExtension(customLogFile).Replace(" ", "_") + ".TpTrace.log"; + string logFileName = string.Empty; + try + { + logFileName = Path.GetFileNameWithoutExtension(customLogFile.TrimStart('"').TrimEnd('"')).Replace(" ", "_"); + } + catch + { + logFileName = Guid.NewGuid().ToString(); + } + + LogFile = Path.Combine(Path.GetTempPath(), logFileName, ".TpTrace.log"); TraceLevel = PlatformTraceLevel.Verbose; return this.TraceInitialized();