microsoft / MixedReality-SceneUnderstanding-Samples

MIT License
52 stars 20 forks source link

x64 build results in -> DLLNotFoundException: Unable to Load DLL 'Microsoft.MixedReality.SceneUnderstanding.dll': The specified module could not be found. #34

Open porter557 opened 1 year ago

porter557 commented 1 year ago

This is NOT the same as this issue: https://github.com/microsoft/MixedReality-SceneUnderstanding-Samples/issues/28j which has a very similar title.

I am able to build and run my project just fine in the Unity Editor (2021.3.6f1).

However, our project requires the use of the SceneUnderstanding module to run in an 'AppRemoting' x64 build on a desktop.

These are my build settings in Unity (2021.3.6f1) image

Build settings in Visual Studio (VS Community 2019 Version 16.11.19) image

The Visual Studio build works just fine! No errors, however, when I attempt to run it. I get the following error:

image

I expected it to be compatible with a desktop build if it could build in Unity and run just fine?

Here's what I have done to attempt to fix it

copied the file '\myProject\Library\PackageCache\com.microsoft.mixedreality.sceneunderstanding@7bfd3a8ea18c\Editor\Plugins\x64\Microsoft.MixedReality.SceneUnderstanding.dll'

To: \myProject\build\build\bin\x64\Release\AppX\

When I do this, the SceneUnderstanding.dll is found, but then I get the following error: image

I will also add that the documentation says its compatible with UWP build: https://learn.microsoft.com/en-us/windows/mixed-reality/develop/unity/scene-understanding-sdk#where-do-i-get-the-sdk

Any help is greatly appreciated :D Is there a way around this?

SzymonSPS commented 1 year ago

Interesting, this is not a case we've seen/tested before. I'll try to repro, but you may be able to test faster than I can given you have this set up. There is a non-0 chance the latest official SDK would handle this case:

https://www.nuget.org/packages/Microsoft.MixedReality.SceneUnderstanding/1.0.14

we've not updated the sample to support it, and some surgery would need to be done. While it's a new major version, the SDK itself should work the same as the previous one, but getting it integrated would mean you need to edit the packages here:

https://github.com/microsoft/MixedReality-SceneUnderstanding-Samples/tree/main/Packages/MixedReality

the new SDK would need to be downloaded and then converted to .tgz so it's rather involved. A simpler hack is to download the nuget, rename to zip, and copy the dll's out and copy them manually to test. You will most likely need to change the code and re-compile, but there's a non-0 chance that it might even work without it, so maybe even repeating your last step:

"copied the file '\myProject\Library\PackageCache\com.microsoft.mixedreality.sceneunderstanding@7bfd3a8ea18c\Editor\Plugins\x64\Microsoft.MixedReality.SceneUnderstanding.dll'

To: \myProject\build\build\bin\x64\Release\AppX\"

using those DLLs work. I'll keep an eye out on this chat to see if I can help.

porter557 commented 1 year ago

Thank you very much for your response!

I was able to download the new SDK, rename the .nuget to .zip and was able to extract the .dll and copy it into my project in the "\myProject\build\build\bin\x64\Release\AppX". I now get this error:

image

At the very least its not saying that the .dll isn't compatible with a win32 app, so thats something :D

SzymonSPS commented 1 year ago

Yes, I think you need to actually upgrade the sample itself to use the newer SDK vs. a drop in. I had a feeling you would hit some breaking changes. But there is a high likelihood of success given the changes from 0.5 to 1.0. We can add upgrading to 1.0 to the backlog but it might take some time just given our schedule.