Skip to content

Fix the issue that the test exits with cannot find Microsoft.Win32.Primitives.dll #117699

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

shimingsg
Copy link
Contributor

Load the name of dll that starts with "Microsoft." from the framework path.

@shimingsg shimingsg requested review from mrsharm and Copilot July 16, 2025 07:01
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 16, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extends the custom assembly resolver to also load framework assemblies whose names start with "Microsoft." from the framework path.

  • Updated the if condition to include assemblies beginning with "Microsoft."
  • Added a clarifying comment about loading framework assemblies
Comments suppressed due to low confidence (1)

src/tests/GC/Stress/Framework/ReliabilityFramework.cs:54

  • Add a unit or integration test to verify that assemblies starting with "Microsoft." are correctly resolved by CustomAssemblyResolver.
        if (assemblyName.Name.StartsWith("System.") || assemblyName.Name.StartsWith("Microsoft."))

@@ -51,8 +51,9 @@ public CustomAssemblyResolver()
protected override Assembly Load(AssemblyName assemblyName)
{
string strPath;
if (assemblyName.Name.StartsWith("System."))
if (assemblyName.Name.StartsWith("System.") || assemblyName.Name.StartsWith("Microsoft."))
Copy link
Preview

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Specify StringComparison when using StartsWith for consistent, culture-insensitive matching (e.g., StartsWith("System.", StringComparison.Ordinal)).

Suggested change
if (assemblyName.Name.StartsWith("System.") || assemblyName.Name.StartsWith("Microsoft."))
if (assemblyName.Name.StartsWith("System.", StringComparison.Ordinal) || assemblyName.Name.StartsWith("Microsoft.", StringComparison.Ordinal))

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant