{"record":{"id":"ef20131e70f93305","repo":"mRemoteNG/mRemoteNG","slug":"unknown-file-version","errorCode":null,"errorMessage":"Unknown file version","messagePattern":"Unknown file version","errorType":"exception","errorClass":"FileFormatException","httpStatus":null,"severity":"error","filePath":"mRemoteNG/Config/Serializers/MiscSerializers/RemoteDesktopConnectionManagerDeserializer.cs","lineNumber":79,"sourceCode":"                if (!(version == new Version(2, 7)) && !(version == new Version(2, 83)))\n                {\n                    throw new FileFormatException($\"Unsupported file version ({version}).\");\n                }\n            }\n            else\n            {\n                string versionNode = rdcManNode?.SelectSingleNode(\"./version\")?.InnerText;\n                if (versionNode != null)\n                {\n                    Version version = new(versionNode);\n                    if (!(version == new Version(2, 2)))\n                    {\n                        throw new FileFormatException($\"Unsupported file version ({version}).\");\n                    }\n                }\n                else\n                {\n                    throw new FileFormatException(\"Unknown file version\");\n                }\n            }\n        }\n\n        private static void ImportFileOrGroup(XmlNode xmlNode, ContainerInfo parentContainer)\n        {\n            ContainerInfo newContainer = ImportContainer(xmlNode, parentContainer);\n\n            XmlNodeList childNodes = xmlNode.SelectNodes(\"./group|./server\");\n            if (childNodes == null) return;\n            foreach (XmlNode childNode in childNodes)\n            {\n                // ReSharper disable once SwitchStatementMissingSomeCases\n                switch (childNode.Name)\n                {\n                    case \"group\":\n                        ImportFileOrGroup(childNode, newContainer);\n                        break;","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/mRemoteNG/mRemoteNG/blob/9211babf35209d6171c8ff6e73bd856f11df21a5/mRemoteNG/Config/Serializers/MiscSerializers/RemoteDesktopConnectionManagerDeserializer.cs#L61-L97","documentation":"Thrown by RemoteDesktopConnectionManagerDeserializer.VerifyFileVersion when the <RDCMan> element has neither a programVersion attribute nor a <version> child node. With no version information at all the importer cannot pick a parsing strategy and aborts with FileFormatException(\"Unknown file version\").","triggerScenarios":"Importing an .rdg file whose <RDCMan> root omits both programVersion attribute and <version> element — typically a hand-authored, truncated, or wrong-format XML file that nonetheless has an <RDCMan> root.","commonSituations":"User selected an XML file that is not a real RDCMan export; file corrupted/truncated during transfer; export from a tool that strips version metadata.","solutions":["Confirm the file is a genuine RDCMan .rdg export by opening it; a valid file has programVersion or a <version> node.","Re-export the connections from RDCMan 2.7.","If authoring .rdg programmatically, always include programVersion=\"2.7\" and schemaVersion=\"3\".","Surface a clear 'unrecognized RDCMan file' message to the user instead of relying on the raw exception."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"XmlNode rdcMan = xmlDocument.SelectSingleNode(\"/RDCMan\");\nbool hasVersion = rdcMan?.Attributes?[\"programVersion\"] != null\n               || rdcMan?.SelectSingleNode(\"./version\") != null;\nif (!hasVersion) throw new FileFormatException(\"File has no RDCMan version information; not a valid .rdg export.\");","typeGuard":"static bool HasAnyRdcManVersion(XmlNode rdcMan) =>\n    rdcMan?.Attributes?[\"programVersion\"] != null || rdcMan?.SelectSingleNode(\"./version\") != null;","tryCatchPattern":"try { deserializer.Deserialize(xml); }\ncatch (FileFormatException ex) when (ex.Message.Contains(\"Unknown file version\"))\n{ throw new InvalidOperationException(\"Selected file is not a recognizable RDCMan export.\", ex); }","preventionTips":["Confirm the file is a genuine RDCMan .rdg export before importing.","Always author .rdg with programVersion and schemaVersion attributes.","Reject files lacking all version metadata rather than letting the parser fail.","Re-export from RDCMan if version metadata is missing."],"tags":["rdcman","rdg","version-check","import","mremoteng","file-format"],"backgroundTag":null,"analyzedSha":"9211babf35209d6171c8ff6e73bd856f11df21a5","analyzedAt":"2026-08-13T19:31:27.817Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}