Skip to content
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

Manually loaded unmanaged dlls can't be found #7

Closed
Ellpeck opened this issue Apr 9, 2020 · 4 comments
Closed

Manually loaded unmanaged dlls can't be found #7

Ellpeck opened this issue Apr 9, 2020 · 4 comments

Comments

@Ellpeck
Copy link

Ellpeck commented Apr 9, 2020

I'm using the MonoGame Framework for a project that I am trying to package with NetCoreBeauty. MonoGame loads its unmanaged dependencies (namely SDL) in an odd way, as seen here.

When running NetCoreBeauty on a simple example project and trying to run it, the SDL2.dll native library can't be found anymore. Moving that file from the runtimes folder to the main folder manually fixes the issue.

Here is a simple example project that you can use to recreate the issue:
MLEMDesktopGLCoreTest.zip (When run successfully, this project simply displays a window with a black background.)

@liesauer
Copy link
Member

liesauer commented Apr 9, 2020

you are right, any dlls that be loaded by DllImport cannot be moved. but unfortunately, NetCoreBeauty cannot determine whether a dll is manually loaded or not. i think the only way to solve this problem is that provide a BeautyExcludes property to exclude dlls that you don't want to be moved or can not be moved. a fix will be available soon.

@Ellpeck
Copy link
Author

Ellpeck commented Apr 9, 2020

That sounds like a pretty good solution. Thanks!

@liesauer
Copy link
Member

liesauer commented Apr 9, 2020

adding <BeautyExcludes>SDL2*;libSDL2*;sdl2*</BeautyExcludes> into csproj file to avoid moving SDL2.
reference:
https://github.com/MonoGame/MonoGame/blob/3b0df35ce1c73435f48953ccd2bb1a8b72c507be/MonoGame.Framework/Platform/SDL/SDL2.cs#L16-L26

@liesauer
Copy link
Member

liesauer commented Apr 9, 2020

UPDATE: after viewing the changes of commit 633b952099, adding openal too for safe.
<BeautyExcludes>SDL2*;libSDL2*;sdl2*;soft_oal*;openal*</BeautyExcludes>

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

No branches or pull requests

2 participants