From 53a9cbcda9a316332f6aaf5e01c537ae40f90f76 Mon Sep 17 00:00:00 2001 From: Akash Lal Date: Sat, 20 Jul 2024 18:01:12 +0530 Subject: [PATCH] match assembly simple name before loading (#508) --- Source/Test/SystematicTesting/TestMethodInfo.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Test/SystematicTesting/TestMethodInfo.cs b/Source/Test/SystematicTesting/TestMethodInfo.cs index fba227c7a..551751714 100644 --- a/Source/Test/SystematicTesting/TestMethodInfo.cs +++ b/Source/Test/SystematicTesting/TestMethodInfo.cs @@ -12,6 +12,7 @@ using System.Runtime.Loader; #endif using System.Threading.Tasks; +using System.Xml.Linq; using Microsoft.Coyote.Actors; using Microsoft.Coyote.Logging; using Microsoft.Coyote.Runtime; @@ -444,9 +445,9 @@ private Assembly OnResolving(AssemblyLoadContext context, AssemblyName assemblyN runtimeLibrary.Dependencies, runtimeLibrary.Serviceable); if (this.AssemblyResolver.TryResolveAssemblyPaths(compilationLibrary, assemblies) && - assemblies.Count > 0) + assemblies.Any(a => string.Equals(Path.GetFileNameWithoutExtension(a), assemblyName.Name, StringComparison.OrdinalIgnoreCase))) { - return this.LoadContext.LoadFromAssemblyPath(assemblies[0]); + return this.LoadContext.LoadFromAssemblyPath(assemblies.First(a => string.Equals(Path.GetFileNameWithoutExtension(a), assemblyName.Name, StringComparison.OrdinalIgnoreCase))); } else {