XAudio native library loading error on UWP (preview) on .NET9 #467
Unanswered
andrew-kulikov
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I'm trying to migrate an UWP application to .NET 9 according to this guide. As part of migration process we decided to migrate from SharpDX to Vortice as it's more modern and NativeAOT friendly.
First I tried to migrate XAudio2 and found a problem with native library (
xaudio2_9.dll
) loading on UWP. When I try to instanciate anIXAudio2
via_device = XAudio2.XAudio2Create();
, it fails with such error message:I checked source code, and found that
XAudio2Native
callsNativeLibrary.TryLoad
method, which retursIntPtr.Zero
. But if I use another overload ofTryLoad
manually, it works fine, and following calls to the library also work:I also checked exatly the same code on WinUI 3 with the same target framework
net9.0-windows10.0.26100.0
, and it works fine. Repository with both samples can be found here: https://github.com/andrew-kulikov/vortice-uwp-dotnet.So there are few questions regarding this:
NativeLibrary.TryLoad
?Beta Was this translation helpful? Give feedback.
All reactions