Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Debugging `DllNotFoundException`

Discussion in 'Scripting' started by michael-burrowes-ts, Oct 24, 2022.

  1. michael-burrowes-ts

    michael-burrowes-ts

    Joined:
    Jun 6, 2022
    Posts:
    3
    I am having difficulty loading native plugins on Mac, as I'm now trying to support both Intel and Silicon versions. Is there anyway to debug the DLL loading process, or get more detailed logs? I've found the `DllNotFoundException` can be thrown for any number of reasons, so it's rather unhelpful in and of itself.
     
  2. michael-burrowes-ts

    michael-burrowes-ts

    Joined:
    Jun 6, 2022
    Posts:
    3
    Upon further inspection, I was able to find logs by setting mono environment variables... It seems like the system tries repeatedly to load the dylib from the MonoBleedingEdge folder, despite the dylib being in the Assets folder. What might cause Unity to not see the one in Assets? This scheme works on other platforms, and used to work on Mac previously.
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,950
    Are you able to make a new project, put in a tiny stub of your DLL code, make a DLL, add interop C# code in a micro-scene that attempts to hit your DLL, make a build and see this issue?

    If so then I would say this is a legitimate Unity bug and you should file a bug using Help -> Report a bug.
     
  4. michael-burrowes-ts

    michael-burrowes-ts

    Joined:
    Jun 6, 2022
    Posts:
    3
    Just tried this, at least with a new Unity project. The code for the DLL is quite expansive, and can't be segmented so easily. Same issue. It seems to be an issue with the DLL I develop, though, since this only started when I updated one of its dependencies (JUCE, even though this only altered source and not the build system; since the build system isn't altered, I'm not sure why it would have repercussions on Unity's ability to load the DLL at all)