Skip to content

suggest show loader snaps in the windows dll load error - #137720

Merged
AaronRobinsonMSFT merged 1 commit into
dotnet:mainfrom
lagudafuadtosin:fix-11891
Nov 17, 2026
Merged

AaronRobinsonMSFT merged 1 commit into
dotnet:mainfrom
lagudafuadtosin:fix-11891

Conversation

@lagudafuadtosin

Copy link
Copy Markdown
Contributor

fixes #11891

the linux and mac messages for a failed native library load say how to diagnose it (LD_DEBUG, DYLD_PRINT_LIBRARIES). the windows one did not. it now suggests show loader snaps. changed in both mscorrc.rc (DllImport) and CoreLib's Strings.resx (NativeLibrary.Load).

tested: on windows, a DllImport and a NativeLibrary.Load of a missing dll both show the new message with coreclr.dll and CoreLib built from this change.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 17, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

I like this suggestion. Aligns with what we do on non-Windows and gives people solid next steps.

@elinor-fung @jtschuster @jkoritzinsky Any concerns?

@elinor-fung

Copy link
Copy Markdown
Member

I like it as well.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the Windows native-library load diagnostic guidance update.

No open issues 🎉

What changed in this PR

Adds diagnostic guidance to Windows native-library load errors, addressing the Windows-specific guidance gap noted in #11891 without changing loading behavior.

Changes:

  • Suggests enabling Show Loader Snaps with gflags and running the application under a debugger.
  • Applies consistent wording to both resource messages while preserving library-name and error-detail placeholders.
File Description
src/​libraries/​System.Private.CoreLib/​src/​Resources/​Strings.resx Adds Windows diagnostic guidance to the managed native-library load error.
src/​coreclr/​dlls/​mscorrc/​mscorrc.rc Adds matching guidance to the CoreCLR DllImport load error.

Review effort: Balanced

@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

/ba-g Unrelated failures.

@AaronRobinsonMSFT
AaronRobinsonMSFT merged commit a3e7f01 into dotnet:main Nov 17, 2026
121 of 125 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Interop-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better error message when not loading native shared library

5 participants