sharpdx / SharpDX

SharpDX GitHub Repository
http://sharpdx.org
MIT License
1.68k stars 642 forks source link

Working on fixing issue #939 #1111

Closed devedse closed 5 years ago

devedse commented 5 years ago

https://github.com/sharpdx/SharpDX/issues/939 was already closed but with version 4.2 of SharpDX new issues appear.

Could someone verify if this is the right fix for this issue?

xoofx commented 5 years ago

You can't remove GetModuleHandleA or LoadLibraryExA like this. They are not part of MediaFoundation. They were introduced in DXGI by 556aee5cd01b7dfa4ded256ef7510f57bcb9df0e so the relevant code (DllImport in Kernel32 interop) need to be put into appropriate ifdef DESKTOP_APP.

devedse commented 5 years ago

I would love to fix this issue, but I'm not sure on how to continue (haven't ever worked with things like this). Would you mind giving some guidance?

xoofx commented 5 years ago

In the file Source/SharpDX.DXGI/Kernel32.cs where the DllImport are causing trouble, you should ifdef the whole file for DESKTOP_APP:

#if DESKTOP_APP
...
#endif
devedse commented 5 years ago

@xoofx , I executed the changes, could you review?

xoofx commented 5 years ago

Thanks. If you could check that is is actually fixing your problem by using the NuGet packages from the build directly: https://ci.appveyor.com/project/xoofx/sharpdx/build/artifacts

devedse commented 5 years ago

@xoofx , yes this has in fact solved the issue:

image

devedse commented 5 years ago

@xoofx , when will this be released to NuGet?