big very sad man
DLL Dependencies Error
I wrote a custom DLL with Visual Studio in C# that I now plan to use in Unity. It contains Windows functions related to Bluetooth and Enumeration. These functions were imported in the class library that compiled the Dll via "Add References" option in VS.
I wrote a file in Unity (test.cs) to access static functions in the file. I repeatedly get the error:
It's peculiar because the entire system appears fine until you click the red button: no unity editor errors, no red lines under any test. When run, it always reports this error.
I know it's not a code issue - I wrote a Unit Test in Visual Studio and it worked perfectly.
I know it's not a file issue - I compiled another function without Windows APIs in another static file within the same Dll/Class Library, and it works perfectly when Unity accesses its functions.
In Unity, Assets/Plugins contains the custom DLL I'm using, System.Runtime.dll, Windows.winmd, Windows.Devices.Bluetooth.dll, and WIndows.Devices.Enumeration.dll. The file I'm using to test it (test.cs) is in the Assets folder.
I am using .NET Framework 4.7.2 Class Library to compile the Dll in Visual Studio, Unity 2022.319f1 with VS as its editor (which reports zero errors when viewed), and a Windows 11 OS Lenovo computer.
Unity compatibility settings are Mono, and .NET Framework.
How do I resolve this? Any help would be appreciated!
---
I'd love to use commands from them directly, but the issue is that I need to use classes from the Windows.Devices.Enumeration namespace so I can't import just static functions like DllImport lets me.
If there's a solution to this that lets me import the class, I'd gladly use it! Looking for anything that resolves or sidesteps this problem RN.
(I am trying to use Windows.Devices.Enumeration.DeviceWatcher class)
167 replies
✅ Test Explorer Skips Async Tests
When I change the test to public async void TestMethod1, the function is skipped by Test Explorer (even when there isn't actually an await function and it's just a Console.WriteLine). When it is switched back to not async (public void TestMethod1) the test is run and successful.
I need to test some async functions. How can I do this?
10 replies