Skip to content

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Sep 2, 2025

DllImportSearchPath.ApplicationDirectory doesn't mean anything on non-Windows. Switch to using DllImportSearchPath.AssemblyDirectory, which will search next to the specified assembly or next to the application for single-file applications.

See #118999

@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 21:10
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 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 use AssemblyDirectory instead of ApplicationDirectory

Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@elinor-fung elinor-fung requested a review from jkotas September 2, 2025 21:11
Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks!

@jkotas
Copy link
Member

jkotas commented Sep 2, 2025

(This is .NET 10 backport candidate.)

Copy link
Member

@MichalStrehovsky MichalStrehovsky left a 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")]?

@elinor-fung elinor-fung merged commit ff381b7 into dotnet:main Sep 3, 2025
97 of 99 checks passed
@elinor-fung elinor-fung deleted the issue118999 branch September 3, 2025 20:17
@elinor-fung
Copy link
Member Author

/backport to release/10.0

Copy link
Contributor

github-actions bot commented Sep 3, 2025

Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17445055447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants