NetworkBehaviorILPP error and failed to find entry-points errors

I’ve been in the process of converting our large application from 2019 using UNET to 2022 with Netcode. I’m to the point where I’m updating all the RPC calls, and was making good process, and then I got hit with several errors that I cannot seem to find an answer to. It would help if they told me more, but they are cryptic.

I’ve been in the process of converting our large application from 2019 using UNET to 2022 with Netcode. I’m to the point where I’m updating all the RPC calls, and was making good process, and then I got hit with several errors that I cannot seem to find an answer to. It would help if they told me more, but they are cryptic.

Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP: (0,0): error - UnityEngine.GameObject: Managed type in NetworkVariable must implement IEquatable<UnityEngine.GameObject>

Assembly ‘Library/ScriptAssemblies/Assembly-CSharp-Editor.dll’ will not be loaded due to errors:
Unable to resolve reference ‘Assembly-CSharp’. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.

Failed to find entry-points:
System.Exception: Could not resolve assembly ‘Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ referenced by the assembly ‘Assembly-CSharp-Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’. Does the assembly name differ from the DLL name (Burst does not support this)? —>

And that last one has a long chain after it, but doesn’t give any hints. Are there any ideas what is causing these, or how to track down what is causing it?

Thanks

And that last one has a long chain after it, but doesn’t give any hints. Are there any ideas what is causing these, or how to track down what is causing it?

Thanks

This tells you exactly that NetworkVariables can only work with IEquatable objects. And in this case this generally won’t work because you cannot send a GameObject over the network. Perhaps UNET had a shortcut for this. In NGO you would do this instead:

// field
NetworkVariable<ulong> theObjectIdVar;

// sender code
var netObj = theGameObject.GetComponent<NetworkObject>();
theObjectIdVar.Value = netObj.NetworkObjectId;

// receiver code
var net = NetworkManager.Singleton;
var netObj = net.SpawnManager.SpawnedObjects[theObjectIdVar.Value];
var go = netObj.gameObject;
var com = netObj.GetComponent<TheComponentYouAreLookingFor>();

But unless you need to synchronize this game object to late joining clients it would be best if you sent this NetworkObjectId (or NetworkObject as NetworkObjectReference) as an RPC parameter.

// client sender
var netObj = GetComponent<NetworkObject>();
SomeServerRpc(netObj)

// server receiver
[Rpc(SendTo.Server)]
public void SomeServerRpc(NetworkObjectReference netObjRef)
{
    if (netObjRef.TryGet(out var netObj))
    {
        // use netObj here
    }
}

Note the implicit conversion of NetworkObject to NetworkObjectReference and how easy it is to get the NetworkObject from the reference via TryGet.

This should work in NGO 1.9 hopefully, I currently work with 2.0 so I’m not 100% sure.

The other errors may be unrelated or follow-up errors. If these persist I would try to delete the Library folder since they seem more like a general failure.

Thanks for the follow up. I was going down that path already, commenting out every RPC call to see if I can find it (of the hundreds in the code), and found out, it wasn’t an RPC call.

One of the legacy SyncVars for of a GameObject got converted to a NetworkVariable. I’m going to try to use a NetworkObjectReference as a NetworkVariable, and see if I can make that work.

THanks!