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. Dismiss Notice

[SOLVED]DllNotFoundException

Discussion in 'Editor & General Support' started by fefolinjo, Jun 7, 2015.

  1. fefolinjo

    fefolinjo

    Joined:
    May 30, 2015
    Posts:
    7
    When building my project for Windows I get this exception no matter if its for x86 or x86_64.

    I've already tried swapping the DLLs (64/32 bit versions) but no change.

    The DLL-s are from SFML (.Net version).

    I have no problem running the game in the Unity editor as I have all the DLL-s in the editor folder.

    They are auto placed into the correct folders at build like they should be (Managed/Plugins).
     
  2. fefolinjo

    fefolinjo

    Joined:
    May 30, 2015
    Posts:
    7
    Solved. Had to put all the dlls next to the game executable, not inside the game_Data folder.
     
  3. sgoodrow

    sgoodrow

    Joined:
    Sep 28, 2012
    Posts:
    150
    What's going on with this? I just encountered this bug myself. Has anyone else determined why this happens?

    Some notes:
    • I'm receiving this error with the FMOD package.
    • It occurs in both 32 and 64 bit builds, but never in the editor.
    • My project hierarchy stores the dlls in the following two locations:
      • Assets/Plugins/x86/fmodstudio.dll
      • Assets/Plugins/x86_64/fmodstudio.dll
    • The code that directly calls the DLL was unchanged at the time that the error stared creeping in. If I preface the call with a Debug.Log command, the error does not occur. Removing the log command returns the error. Perhaps something related to execution order being imprecisely defined?
    • The DLL is called multiple times successfully before this call fails.
    • Moving the DLL to be adjacent to the executable, instead of in the _Data/Plugins folder, resolves the error.
    What can I do to resolve this?
     
    Last edited: Jun 12, 2015
  4. MadboyJames

    MadboyJames

    Joined:
    Oct 28, 2017
    Posts:
    262
    7 years dead... *dons necromancer robes*

    I have this exact issue, and moving fmodstudio.dll to the same folder as the executable did not resolve the issue.

    My log shows
    Code (CSharp):
    1. Fallback handler could not load library C:/Users/Jkc36/Desktop/Testbuild/Reckoning_Data/MonoBleedingEdge/fmodstudioL
    which means that unity is looking for the dll inside GAMENAME_Data/MonoBleedingEdge... which is weird because MonoBleedingEdge is a sibling of GAMENAME_Data... and even if it was a child, the dll is inside GAMENAME_Data/Plugins, not MonoBleedingEdge.

    If I rename GAMENAME_Data/Plugins to GAMENAME_Data/MonoBleedingEdge, the error changes slightly
    Code (CSharp):
    1. Fallback handler could not load library C:/Users/Jkc36/Desktop/Testbuild/Reckoning_Data/MonoBleedingEdge/x86_64/fmodstudioL
    indicating that it is trying to load the path. I think part of the issue is that the fmodstudioL.dll does not exist in my project. fmodstudio.dll exists, but not fmodstudioL.dll.

    So... does anyone know what is causing this issue, and how to fix it?
     
  5. MadboyJames

    MadboyJames

    Joined:
    Oct 28, 2017
    Posts:
    262
    I figured out my issue. I am using additive loading, and I have an "init" scene which had a gameobject which restored some volume settings on awake. Turns out that the .dll is not loaded yet and the volume setting restore needed to be moved to on start.