{"record":{"id":"f7174bf84e9946de","repo":"Unity-Technologies/UnityCsReference","slug":"unsupported-dependencygraph-version-version-d","errorCode":null,"errorMessage":"Unsupported DependencyGraph version ({version}).\nDependencyGraph file is either corrupted or from a newer version of Unity.","messagePattern":"Unsupported DependencyGraph version \\((.+?)\\)\\.\nDependencyGraph file is either corrupted or from a newer version of Unity\\.","errorType":"exception","errorClass":"InvalidDataException","httpStatus":null,"severity":"critical","filePath":"Editor/Mono/Scripting/APIUpdater/AssemblyDependencyGraph.cs","lineNumber":300,"sourceCode":"        {\n            ValidateMinimumLength(stream);\n\n            Span<byte> signatureHashSpan = stackalloc byte[Signature.Length];\n            var read = stream.Read(signatureHashSpan);\n            Debug.Assert(read == signatureHashSpan.Length); // ValidateMinimumLength() guarantees there's enough data to fulfill the request.\n\n            if (!signatureHashSpan.SequenceEqual(Signature))\n            {\n                throw new InvalidDataException($\"\"\"\n                                                Invalid signature ({BitConverter.ToString(signatureHashSpan.ToArray())}) found (Expected: {BitConverter.ToString(Signature)}).{Environment.NewLine}\n                                                DependencyGraph file is either corrupted or from a previous version of Unity. If you observe inexplicable runtime/compilation errors, please delete `Library/` folder and reopen the project.\n                                                \"\"\");\n            }\n\n            int version = stream.ReadByte();\n            if (version != Version)\n            {\n                throw new InvalidDataException($\"\"\"\n                                                Unsupported DependencyGraph version ({version}).{Environment.NewLine}\n                                                DependencyGraph file is either corrupted or from a newer version of Unity.\n                                                \"\"\");\n            }\n\n            Span<byte> hashLengthSpan = stackalloc byte[sizeof(long)];\n            read = stream.Read(hashLengthSpan);\n            if (read != hashLengthSpan.Length)\n                throw new InvalidDataException($\"Read only {read} out of {hashLengthSpan.Length} bytes for hash length.\");\n\n            long hashLengthSize = BitConverter.ToInt64(hashLengthSpan);\n            Debug.Assert(hashLengthSize < 256);\n            Span<byte> storedHash = stackalloc byte[(int)hashLengthSize];\n            read = stream.Read(storedHash);\n            if (read != hashLengthSize)\n                throw new InvalidDataException($\"Read only {read} out of {storedHash.Length} bytes for hash.\");\n\n            var startOfSerializedData = stream.Position;","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Scripting/APIUpdater/AssemblyDependencyGraph.cs#L282-L318","documentation":"Thrown by AssemblyDependencyGraph.LoadFrom as InvalidDataException when the version byte read from the file does not match the current Version constant. The signature matched (so the file is a valid DependencyGraph file), but the format version is different, indicating it was written by a different Unity version. This is distinct from the signature error: the file is recognized but its internal layout is incompatible.","triggerScenarios":"Upgrading or downgrading Unity versions where the DependencyGraph format version changed. Opening a project last edited in a newer Unity version with an older editor.","commonSituations":"Team members on different Unity LTS versions. CI pipeline using a different Unity version than developers. Upgrading a project and not clearing Library/.","solutions":["Delete the Library/ folder and reopen the project so Unity regenerates the DependencyGraph in the correct version.","Standardize the Unity version across the team and CI.","If upgrading, follow Unity's recommended upgrade path and clear cached data."],"exampleFix":"// No code fix; environment issue.\n// Terminal fix:\n//   rm -rf Library/\n// Then reopen the project in Unity.","handlingStrategy":"fallback","validationCode":"// No runtime validation; version mismatch requires regenerating the file.\n// Ensure consistent Unity editor version across all environments.","typeGuard":null,"tryCatchPattern":"try\n{\n    AssemblyDependencyGraph.LoadFrom(stream);\n}\ncatch (InvalidDataException)\n{\n    // Delete Library/ and reopen the project.\n}","preventionTips":["Pin the Unity version in the team and CI.","Delete Library/ after any Unity upgrade or downgrade.","Use Unity Hub to enforce version consistency."],"tags":["unity","dependency-graph","editor","version-mismatch"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}