From 431592110738aa93aca90e90c6ca17ee7a6d2ea0 Mon Sep 17 00:00:00 2001 From: ZQ Wang <271418+wangzq@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:22:14 -0700 Subject: [PATCH] Fix concurrency bug in AssemblyHelper (#407) --- .../Utility/AssemblyResolution/AssemblyHelper_Desktop.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xunit.runner.visualstudio/Utility/AssemblyResolution/AssemblyHelper_Desktop.cs b/src/xunit.runner.visualstudio/Utility/AssemblyResolution/AssemblyHelper_Desktop.cs index d3be0d9..7b50139 100644 --- a/src/xunit.runner.visualstudio/Utility/AssemblyResolution/AssemblyHelper_Desktop.cs +++ b/src/xunit.runner.visualstudio/Utility/AssemblyResolution/AssemblyHelper_Desktop.cs @@ -1,7 +1,7 @@ #if NETFRAMEWORK using System; -using System.Collections.Generic; +using System.Collections.Concurrent; using System.IO; using System.Reflection; using Xunit.Abstractions; @@ -19,7 +19,7 @@ class AssemblyHelper : LongLivedMarshalByRefObject, IDisposable readonly string directory; readonly IMessageSink? internalDiagnosticsMessageSink; - readonly Dictionary lookupCache = new(); + readonly ConcurrentDictionary lookupCache = new(); /// /// Constructs an instance using the given for resolution.