Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue/crash with deployment items and disabled app domains #1681

Merged
merged 1 commit into from
May 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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