-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Use DllImportSearchPath.AssemblyDirectory for loading jitinterface library #119287
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
Conversation
There was a problem hiding this 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 fixes a cross-platform issue with loading the jitinterface library by changing the DLL search path from ApplicationDirectory
to AssemblyDirectory
. The change ensures proper library loading on non-Windows platforms where ApplicationDirectory
is not meaningful.
- Updated the
DllImportSearchPath
parameter to useAssemblyDirectory
instead ofApplicationDirectory
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
(This is .NET 10 backport candidate.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to mark DllImportSearchPath
values that don't make sense outside Windows as [SupportedOSPlatform("windows")]
?
/backport to release/10.0 |
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17445055447 |
DllImportSearchPath.ApplicationDirectory
doesn't mean anything on non-Windows. Switch to usingDllImportSearchPath.AssemblyDirectory
, which will search next to the specified assembly or next to the application for single-file applications.See #118999