Home Forums Support NLog Error with Unity3D

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #462
    Anonymous
    Inactive

    First of all, if this should be in a new thread let me know to start it.

    I don’t know if it’s a bug, but when I use the library in Unity3D, as it tries to execute this line (or any appendGlobalIncomingPacketHandler):

    NetworkComms.AppendGlobalIncomingPacketHandler(“Resp”,myResponseHandler );

    It throws this error:
    ArgumentNullException: Argument cannot be null.
    Parameter name: path1
    System.IO.Path.Combine (System.String path1, System.String path2) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.IO/Path.cs:112)
    NLog.LogFactory+d__3.MoveNext ()
    NLog.LogFactory.get_Configuration ()
    NLog.LogFactory.GetLogger (NLog.LoggerCacheKey cacheKey)
    NLog.LogFactory.GetLogger (System.String name)
    NLog.LogManager.GetCurrentClassLogger ()
    NetworkCommsDotNet.NetworkComms..cctor ()
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for NetworkCommsDotNet.NetworkComms
    SimpleMesh.startNetworking () (at Assets/Scripts/SimpleMesh.cs:112)
    SimpleMesh.Update () (at Assets/Scripts/SimpleMesh.cs:125)

    Since the error comes from Nlog, I’ve disabled logging, but it’s still happening. Searching about this error, it seems that Unity doesn’t work properly with the properties used by some libraries.

    I’ll try to work on it to avoid this error but I thought it should be OK to let you know about it.

    #464
    MarcF
    Keymaster

    Interesting error. As far as we were aware people had been using the v2.2 alpha successfully in unity 3d. I’ll see if one of the developers can look at this in the next couple of days.

    In the mean time if you find a solution please let us know.

    Regards,
    Marc

    #465
    Anonymous
    Inactive

    No luck with this.
    The same error is thrown whenever I use any method of the library. I’ve tried disabling logging with no luck, and to try in different versions of Unity.

    I’m using unity indie, windows 7 64bits and the built-in MonoDevelop.

    #466
    MarcF
    Keymaster

    That would make sense. The error is caused during the initialisation of comms which happens before logging is disabled/enabled. It is possible to prevent the error from happening by manually removing the logging functionality but we are ‘today’ looking for an alternative which would allow the logging to be used with unity.

    #467
    MarcF
    Keymaster

    We have a working fix that allows NetworkComms.Net to work correctly in unity but at the loss of any logging functionality. We are continuing work to make logging available as soon as possible but I may end up requiring some changes to NLog. If you want the current fix please let us know.

    #468
    Anonymous
    Inactive

    I’ll wait until the final version comes out to use it with Unity since the log feature is a great one.
    In the meantime I’ll keep playing with it in the other plattforms 🙂

    Thanks a lot!

    #469
    MarcF
    Keymaster

    ok, this has been completely fixed. It will be part of the v2.2 release (hopefully within the next week). If you would like another alpha copy before then let me know.

    Regards,
    Marc

    #470
    MarcF
    Keymaster

    Scratch that, after some further testing there are still issues. It runs successfully and outputs ‘some’ logging data but for some reason it does not seem to log everything. This appears to be a problem with the nlog framework as the comms code executes without issue. I’ll try to get in touch with the NLog guys and see if we can work out what the problem is.

    #485
    MarcF
    Keymaster

    Ok, all Unity3D issues have now been fixed and will be in the v2.2 network library release.

    #505
    MarcF
    Keymaster

    Just to update. We have now released v2.2.0. If you use the .net2.0 build all features should be working.

    Thanks again.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.