Skip to content

Commit e995327

Browse files
authored
Fix issue/crash with deployment items and disabled app domains (#1681)
1 parent b444674 commit e995327

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/Adapter/MSTestAdapter.PlatformServices/AssemblyResolver.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ public class AssemblyResolver : MarshalByRefObject, IDisposable
4242
/// </remarks>
4343
private const string LoggerAssemblyName = "Microsoft.TestPlatform.CoreUtilities";
4444

45+
/// <summary>
46+
/// The name of the current assembly resources file.
47+
/// </summary>
48+
/// <remarks>
49+
/// When resolving the resources for the current assembly, we need to make sure that we do not log. Otherwise, we will end
50+
/// up either failing or at least printing warning messages to the user about how we could not load the resources dll even
51+
/// when it's not an error. For example, set a culture outside of supported cultures (e.g. en-gb) and you will have an error
52+
/// saying we could not find en-gb resource dll which is normal. For more information,
53+
/// <see href="https://github.com/microsoft/testfx/issues/1598" />.
54+
/// </remarks>
55+
private const string PlatformServicesResourcesName = "Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources";
56+
4557
/// <summary>
4658
/// This will have the list of all directories read from runsettings.
4759
/// </summary>
@@ -587,7 +599,8 @@ private static void SafeLog(string? assemblyName, Action loggerAction)
587599
// Logger assembly was in `Microsoft.VisualStudio.TestPlatform.ObjectModel` assembly in legacy versions and we need to omit it as well.
588600
if (!StringEx.IsNullOrEmpty(assemblyName)
589601
&& !assemblyName.StartsWith(LoggerAssemblyName)
590-
&& !assemblyName.StartsWith(LoggerAssemblyNameLegacy))
602+
&& !assemblyName.StartsWith(LoggerAssemblyNameLegacy)
603+
&& !assemblyName.StartsWith(PlatformServicesResourcesName))
591604
{
592605
loggerAction.Invoke();
593606
}

0 commit comments

Comments
 (0)