Search Unity

Bug DllNotFoundException: nanosockets assembly:<unknown assembly> type:<unknown type> member:(null)

Discussion in 'Editor & General Support' started by masta-yoda, Feb 17, 2023.

  1. masta-yoda

    masta-yoda

    Joined:
    Apr 19, 2020
    Posts:
    91
    The Unity Editor 2022.2.7f1 is unable to find the Dll with the following error:

    > DllNotFoundException: nanosockets assembly:<unknown assembly> type:<unknown type> member:(null)

    It works only when I build a package and run it on a device (Android, PC). The library is enabled for the editor in settings (Unity studio restarted):



    Full stacktrack:

    DllNotFoundException: nanosockets assembly:<unknown assembly> type:<unknown type> member:(null)
    Fusion.Sockets.NetAddress.CreateFromIpPort (System.String ip, System.UInt16 port) (at Fusion/Fusion.Sockets/NetAddress.cs:145)
    Fusion.Sockets.NetAddress.Any (System.UInt16 port) (at Fusion/Fusion.Sockets/NetAddress.cs:116)
    Fusion.NetworkRunner.StartGameModeCloud (Fusion.StartGameArgs args) (at Fusion/Fusion.Runtime/Runner/NetworkRunner.Matchmaking.cs:821)
    UnityEngine.Debug:LogException(Exception)
    Fusion.FusionUnityLogger:LogException(String, DefaultContext&, Exception) (at Assets/Photon/Fusion/Scripts/FusionUnityLogger.cs:143)
    Fusion.Log:Exception(NetworkRunner, Exception) (at Fusion/Fusion.Common/Log.cs:138)
    Fusion.<ShutdownWithException>d__315:MoveNext() (at Fusion/Fusion.Runtime/Runner/NetworkRunner.Matchmaking.cs:906)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start(<ShutdownWithException>d__315&)
    Fusion.NetworkRunner:ShutdownWithException(Exception)
    Fusion.<StartGameModeCloud>d__314:MoveNext() (at Fusion/Fusion.Runtime/Runner/NetworkRunner.Matchmaking.cs:884)
    System.Threading.Tasks.TaskCompletionSource`1:TrySetResult(Int16)
    Fusion.Photon.Realtime.Async.OperationHandler:SetResult(Int16) (at Fusion/Fusion.Realtime/RealtimeExtensions/OperationHandler.cs:34)
    Fusion.Photon.Realtime.Async.OperationHandler:OnJoinedRoom() (at Fusion/Fusion.Realtime/RealtimeExtensions/OperationHandler.cs:122)
    Fusion.Photon.Realtime.MatchMakingCallbacksContainer:OnJoinedRoom() (at Fusion/Fusion.Realtime/Realtime/LoadBalancingClient.cs:4206)
    Fusion.Photon.Realtime.LoadBalancingClient:OnEvent(EventData) (at Fusion/Fusion.Realtime/Realtime/LoadBalancingClient.cs:3240)
    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer) (at C:/Dev/photon-sdk-dotnet/PhotonDotNet/PeerBase.cs:899)
    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotNet/EnetPeer.cs:577)
    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotNet/PhotonPeer.cs:1771)
    ExitGames.Client.Photon.PhotonPeer:Service() (at C:/Dev/photon-sdk-dotnet/PhotonDotNet/PhotonPeer.cs:1685)
    Fusion.Photon.Realtime.LoadBalancingClient:Service() (at Fusion/Fusion.Realtime/Realtime/LoadBalancingClient.cs:1412)
    Fusion.Photon.Realtime.FusionRelayClient:Update() (at Fusion/Fusion.Realtime/Client/FusionRelayClient.cs:234)
    Fusion.CloudCommunicator:Service() (at Fusion/Fusion.Runtime/CloudServices/CloudCommunicator.cs:51)
    Fusion.CloudServices:Update() (at Fusion/Fusion.Runtime/CloudServices/CloudServices.cs:175)
    Fusion.NetworkRunner:Update() (at Fusion/Fusion.Runtime/Runner/NetworkRunner.cs:1316)


    What did I miss in configuring this library usage in the editor?
     
    bleater and pokelocos like this.
  2. pokelocos

    pokelocos

    Joined:
    Nov 9, 2015
    Posts:
    54
    same problem but in 2022.2.9f1
     
  3. users_names

    users_names

    Joined:
    Aug 21, 2017
    Posts:
    4
    Can confirm: this "feature" is still present in 2022.3.3f1 LTS version :mad:
    Hint: even if the same ("unfound") DLL is present in the Assets folder (sub folder) multiple times, unity doesnt yield the usual error for that - hence it seems that its not recognizing DLL-s in the Assets at all?

    Anyone from Unity: do you have predictions whether this will be repaired before christmas 2024 or later.. maybe?
     
    bleater likes this.
  4. FlyingSquirrels

    FlyingSquirrels

    Joined:
    Sep 18, 2015
    Posts:
    84
    @masta-yoda @pokelocos @users_names did you have any luck resolving this, please?

    We are having a similar problem when building as Dedicated Linux Server, if we use the API:

    Code (CSharp):
    1. NetAddress.Any(port)
    we get:

    Code (CSharp):
    1. DllNotFoundException: nanosockets assembly:<unknown assembly> type:<unknown type> member:(null)
     
    bleater likes this.
  5. FlyingSquirrels

    FlyingSquirrels

    Joined:
    Sep 18, 2015
    Posts:
    84
    Update. Fusion SDK 1.18 has a new libnanosocket.so file specifically for Linux.

    Adding this file fixed our issue.
     
  6. henrique11

    henrique11

    Joined:
    Jan 1, 2020
    Posts:
    3
    Same problem here (DllNotFoundException: MyBasicDLL assembly:<unknown assembly> type:<unknown type> member:(null)).
    However, when I installed Visual Studio, it got fixed. It seems that my DLLs have dependencies that come from Visual Studio. I am still trying to figure out how to include those dependencies in my Build so that I can run my application on machines that don't have Visual Studio installed on them.
     
  7. henrique11

    henrique11

    Joined:
    Jan 1, 2020
    Posts:
    3
    Update:
    I inserted the command
    dumpbin /dependents path_to_your_dll_file.dll
    in Visual Studio Terminal, and it listed the DLL dependencies for your_dll_file.dll.
    I searched for the DLLs in the standard Windows search bar.
    I copied those files into my Unity project Assets/Plugins.
    Now, I can run my application on other machines that don't have Visual Studio.

    Credit: https://stackoverflow.com/questions/7378959/how-to-check-for-dll-dependency
     
  8. bleater

    bleater

    Joined:
    Apr 19, 2012
    Posts:
    28
    Had the exact same problem. I have tried many different approaches without much success.

    One thing I have discovered is that sometimes there is a crashed version of Unity running as a zombie background process and still holding a lock on this DLL. You can verify this using Process Explorer (download from https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer). From within Process Explorer, choose "Find" -> "Find Process or DLL" and in the dialog type "nanosockets.dll" and press the "Search" button. In many cases, this would show that a zombie instance of Unity.exe had the dll open.
     
    Last edited: Mar 13, 2024