Compile / Code Gen Error: Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP: (0,0)
See original GitHub issueDescription
On Unity 2022.2.0a12, Latest version of NGO (hash: 6d54e2878bc80b92f32a618473162763b56b38ce), the package fails to compile.
I feel this is related to https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/1920 , I tried with different versions of the Mono.Cecil package with no luck (1.10.1 through 1.11.4).
Reproduce Steps
- Install Unity 2022.2.0a12.
- Install Netcode for GameObjects via git
- Notice compile error after compilation finishes
Actual Outcome
Unity prints the error
Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP: (0,0): error - System.InvalidCastException: Unable to cast object of type 'Mono.Cecil.ArrayType' to type 'Mono.Cecil.GenericInstanceType'.|| at Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP.ResolveGenericType(TypeReference type, List
1 typeStack)|| at Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP.Process(ICompiledAssembly compiledAssembly) at Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP.ResolveGenericType(TypeReference type, List1 typeStack)|| at Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP.Process(ICompiledAssembly compiledAssembly)
Expected Outcome
The project should compile
Environment
- OS: Windows 10 Pro 21H1
- Unity Version: 2022.2.0a12
- Netcode Version: 1.0.0-pre.9
- Netcode Commit: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/6d54e2878bc80b92f32a618473162763b56b38ce
Issue Analytics
- State:
- Created a year ago
- Comments:12 (3 by maintainers)
Top GitHub Comments
Tracked in our backlog MTT-4087
Also having an issue with pre-9. This repo by Dilmer works on pre-3 but fails on pre-9. https://github.com/dilmerv/UnityMultiplayerPlayground With this error:
(0,0): error - System.NullReferenceException: Object reference not set to an instance of an object.|| at Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP.Process(ICompiledAssembly compiledAssembly) in D:\repos\bombbomb\Library\PackageCache\com.unity.netcode.gameobjects@1.0.0-pre.9\Editor\CodeGen\INetworkSerializableILPP.cs:line 116 at Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP.Process(ICompiledAssembly compiledAssembly) in D:\repos\bombbomb\Library\PackageCache\com.unity.netcode.gameobjects@1.0.0-pre.9\Editor\CodeGen\INetworkSerializableILPP.cs:line 116