Skip to content

Commit

Permalink
Fix issue/crash with deployment items and disabled app domains (#1681)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink committed May 29, 2023
1 parent b444674 commit e995327
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Adapter/MSTestAdapter.PlatformServices/AssemblyResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ public class AssemblyResolver : MarshalByRefObject, IDisposable
/// </remarks>
private const string LoggerAssemblyName = "Microsoft.TestPlatform.CoreUtilities";

/// <summary>
/// The name of the current assembly resources file.
/// </summary>
/// <remarks>
/// When resolving the resources for the current assembly, we need to make sure that we do not log. Otherwise, we will end
/// up either failing or at least printing warning messages to the user about how we could not load the resources dll even
/// 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
/// saying we could not find en-gb resource dll which is normal. For more information,
/// <see href="https://github.com/microsoft/testfx/issues/1598" />.
/// </remarks>
private const string PlatformServicesResourcesName = "Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources";

/// <summary>
/// This will have the list of all directories read from runsettings.
/// </summary>
Expand Down Expand Up @@ -587,7 +599,8 @@ private static void SafeLog(string? assemblyName, Action loggerAction)
// Logger assembly was in `Microsoft.VisualStudio.TestPlatform.ObjectModel` assembly in legacy versions and we need to omit it as well.
if (!StringEx.IsNullOrEmpty(assemblyName)
&& !assemblyName.StartsWith(LoggerAssemblyName)
&& !assemblyName.StartsWith(LoggerAssemblyNameLegacy))
&& !assemblyName.StartsWith(LoggerAssemblyNameLegacy)
&& !assemblyName.StartsWith(PlatformServicesResourcesName))
{
loggerAction.Invoke();
}
Expand Down

0 comments on commit e995327

Please sign in to comment.