Skip to content

Fix Dll SearchPath to include Assembly Directory. #69

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

Merged
merged 1 commit into from
Aug 6, 2020

Conversation

dellis1972
Copy link
Contributor

Commit 28b4639 added the ability to load the 32bit
dll from the current directory. However on MacOS/dotnet
this does not work. The current DllImportSearchPath
setting only allows for loading from known Safe paths.

On MacOS/dotnet it seems this does not include the
assembly directoy. Our current setup in Xamarin.Android
places the native libaries in the same directory as
the assembly, so we need that to work.

The fix is to include the value AssemblyDirectory in the
DllImportSearchPath setting as well as the SafeDirectories
value. This should allow dotnet to find native libraries which
are in the same directory.

Commit 28b4639 added the ability to load the 32bit
dll from the current directory. However on MacOS/dotnet
this does not work. The current `DllImportSearchPath`
setting only allows for loading from known `Safe` paths.

On MacOS/dotnet it seems this does not include the
assembly directoy. Our current setup in Xamarin.Android
places the native libaries in the same directory as
the assembly, so we need that to work.

The fix is to include the value `AssemblyDirectory` in the
`DllImportSearchPath` setting as well as the `SafeDirectories`
value. This should allow `dotnet` to find native libraries which
are in the same directory.
@dellis1972 dellis1972 requested a review from grendello August 6, 2020 19:08
@grendello grendello merged commit 2b1762f into dotnet:master Aug 6, 2020
@dellis1972 dellis1972 deleted the fixwindowssearch branch August 7, 2020 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants