{"record":{"id":"a766d0cfcf893a64","repo":"NickeManarin/ScreenToGif","slug":"project-not-compatible-with-this-version","errorCode":null,"errorMessage":"Project not compatible with this version","messagePattern":"Project not compatible with this version","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"ScreenToGif/Windows/Editor.xaml.cs","lineNumber":4113,"sourceCode":"                List<FrameInfo> list;\n\n                if (File.Exists(Path.Combine(pathTemp, \"Project.json\")))\n                {\n                    //Read as text.\n                    var json = File.ReadAllText(Path.Combine(pathTemp, \"Project.json\"));\n\n                    using (var ms = new MemoryStream(Encoding.UTF8.GetBytes(json)))\n                    {\n                        var ser = new DataContractJsonSerializer(typeof(ProjectInfo));\n                        var project = ser.ReadObject(ms) as ProjectInfo;\n\n                        list = project?.Frames;\n                    }\n                }\n                else\n                {\n                    if (File.Exists(Path.Combine(pathTemp, \"List.sb\")))\n                        throw new Exception(\"Project not compatible with this version\");\n\n                    throw new FileNotFoundException(\"Impossible to open project.\", \"List.sb\");\n                }\n\n                //Shows the ProgressBar\n                ShowProgress(LocalizationHelper.Get(\"S.Editor.ImportingFrames\"), list?.Count ?? 0);\n\n                var count = 0;\n                foreach (var frame in list ?? [])\n                {\n                    //Change the file path to the current one.\n                    frame.Path = Path.Combine(pathTemp, Path.GetFileName(frame.Path));\n\n                    count++;\n                    UpdateProgress(count);\n                }\n\n                return list;","sourceCodeStart":4095,"sourceCodeEnd":4131,"githubUrl":"https://github.com/NickeManarin/ScreenToGif/blob/a4d0a67c2131cd048ceec86cd40afc2f1a06f2fd/ScreenToGif/Windows/Editor.xaml.cs#L4095-L4131","documentation":"ImportFromProject extracts a project .zip and looks for Project.json (the modern project manifest). If Project.json is absent but the legacy List.sb exists, it throws — the project was saved by an older ScreenToGif version that used binary serialization and is no longer loadable by this build.","triggerScenarios":"Opening a .stg/project archive whose contents include List.sb but not Project.json.","commonSituations":"User opens a project saved by ScreenToGif ≈ pre-2019 builds; project migrated from an old backup; project from a fork that still emits List.sb.","solutions":["Install an older ScreenToGif version that supports List.sb, open and re-save the project so it serializes to Project.json.","If you control the source, re-export the project from the original recording.","Communicate to the user that legacy projects must be re-saved by a transitional build.","Add a one-time migration path: detect List.sb and deserialize via the legacy BinaryFormatter before throwing."],"exampleFix":"// before\nif (File.Exists(Path.Combine(pathTemp, \"List.sb\")))\n    throw new Exception(\"Project not compatible with this version\");\n\n// after\nif (File.Exists(Path.Combine(pathTemp, \"List.sb\")))\n    throw new Exception(\"Project not compatible with this version. It uses the legacy List.sb format. Open it in an older ScreenToGif build and re-save to convert to Project.json.\");","handlingStrategy":"validation","validationCode":"// Inspect the extracted folder before deserializing\nbool hasModern = File.Exists(Path.Combine(pathTemp, \"Project.json\"));\nbool hasLegacy = File.Exists(Path.Combine(pathTemp, \"List.sb\"));\nif (!hasModern && hasLegacy) /* warn: legacy project — must be re-saved by older build */","typeGuard":"static ProjectFormat DetectProjectFormat(string pathTemp) =>\n    File.Exists(Path.Combine(pathTemp, \"Project.json\")) ? ProjectFormat.Modern :\n    File.Exists(Path.Combine(pathTemp, \"List.sb\"))     ? ProjectFormat.Legacy  :\n    ProjectFormat.Unknown;","tryCatchPattern":"try { return ImportFromProject(source, pathTemp); }\ncatch (Exception ex) when (ex.Message.Contains(\"not compatible\"))\n{ /* inform user the project is from an older ScreenToGif version */ }","preventionTips":["Tag saved projects with a schema version field to support forward-compatible migrations.","Keep a transitional build around that can open List.sb and re-save as Project.json.","Communicate supported project versions in the import dialog."],"tags":["project","import","legacy","version-mismatch"],"backgroundTag":null,"analyzedSha":"a4d0a67c2131cd048ceec86cd40afc2f1a06f2fd","analyzedAt":"2026-08-13T11:12:06.147Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}