【发布时间】:2021-06-24 05:58:32
【问题描述】:
我有一个来自 this solution 的 c++ .dll 和 .winmd。当我将它们放在 Unity 的 Plugin 文件夹中,构建 Universal Windows 项目并部署到 Hololens 2 时,.dll 和 .winmd 中的类被识别。
如果我创建一个 Visual Studio Universal Windows XAML 项目,请将 .dll 和 .winmd 复制到项目路径并通过 Reference-Add 包含 .winmd,所有类在编辑期间都在那里(在编辑和建设)。当我构建解决方案时,.dll 也被复制到构建路径。但是,如果我部署并运行代码,项目会抛出以下异常:
'ResearchMode.exe' (Win32): Unloaded U:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\78ac9912-63f6-43a8-b469-6e4684f8ea08VS.Release_ARM.cwule\HoloLensForCV.dll
onecore\com\combase\objact\dllcache.cxx(2132)\combase.dll!7728B3FD: (caller: 771AC799) ReturnHr(1) tid(178) 8007007E The specified module could not be found.
onecore\com\combase\objact\dllcache.cxx(4634)\combase.dll!771AC7B3: (caller: 771AB0A9) ReturnHr(2) tid(178) 8007007E The specified module could not be found.
onecore\com\combase\objact\dllcache.cxx(4766)\combase.dll!771AC7CB: (caller: 771AB0A9) ReturnHr(3) tid(178) 8007007E The specified module could not be found.
Exception thrown: 'System.IO.FileNotFoundException' in System.Private.Interop.dll
The specified module could not be found. (Exception from HRESULT: 0x8007007E)
我是否错误地包括了.winmd 和.dll?为什么它们为 Unity 项目正确加载但不为 XAML 项目加载的原因可能是什么?我还需要为这些程序集指定 Unity 可能已经为我做的我不知道的其他任何事情吗?
【问题讨论】:
标签: c# visual-studio unity3d hololens