{"record":{"id":"9c2baf90afc716cc","repo":"dotnet/wpf","slug":"value-cannot-be-null-parameter-updaterversion","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'updaterVersion')","messagePattern":"Value cannot be null\\. \\(Parameter 'updaterVersion'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/WindowsBase/System/IO/Packaging/CompoundFile/FormatVersion.cs","lineNumber":73,"sourceCode":"        /// and writer version\n        /// </summary>\n        /// <param name=\"featureId\">feature identifier</param>\n        /// <param name=\"writerVersion\">Writer Version</param>\n        /// <param name=\"readerVersion\">Reader Version</param>\n        /// <param name=\"updaterVersion\">Updater Version</param>\n        public FormatVersion(String featureId,\n                                VersionPair writerVersion,\n                                VersionPair readerVersion,\n                                VersionPair updaterVersion)\n        {\n            if (featureId == null)\n                throw new ArgumentNullException(nameof(featureId));\n            if (writerVersion == null)\n                throw new ArgumentNullException(nameof(writerVersion));\n            if (readerVersion == null)\n                throw new ArgumentNullException(nameof(readerVersion));\n            if (updaterVersion == null)\n                throw new ArgumentNullException(nameof(updaterVersion));\n\n            if (featureId.Length == 0)\n            {\n                throw new ArgumentException(SR.ZeroLengthFeatureID);\n            }\n\n            _featureIdentifier = featureId;\n            _reader = readerVersion;\n            _updater = updaterVersion;\n            _writer = writerVersion;\n        }\n\n        #endregion Constructors\n\n        //------------------------------------------------------\n        //\n        //  Public Properties\n        //","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/IO/Packaging/CompoundFile/FormatVersion.cs#L55-L91","documentation":"ArgumentNullException from the FormatVersion constructor when updaterVersion is null. The updater version records the minimum version able to update the data and, like the other two versions, must be present for a valid DataSpace version entry.","triggerScenarios":"new FormatVersion(featureId, writerVersion, readerVersion, null) — passing a null updater VersionPair.","commonSituations":"Constructing version blocks in tooling that only tracks writer/reader versions; uninitialized fields after refactoring.","solutions":["Pass a valid VersionPair for updaterVersion (e.g. new VersionPair(1, 0))","Verify all three version arguments before invoking the constructor","Use the DataSpaceCurrentUpdaterVersion equivalent (1.0) as a default"],"exampleFix":"// before\nvar fv = new FormatVersion(id, writer, reader, null);\n// after\nvar updater = new VersionPair(1, 0);\nvar fv = new FormatVersion(id, writer, reader, updater);","handlingStrategy":"validation","validationCode":"if (updaterVersion == null) throw new ArgumentException(\"updaterVersion is required\");\nvar fv = new FormatVersion(featureId, writerVersion, readerVersion, updaterVersion);","typeGuard":"static bool IsValidVersion(VersionPair v) => v != null;","tryCatchPattern":null,"preventionTips":["Always supply the updater version; mirror the library default of 1.0","Group the three VersionPair values in one initializer to avoid omissions","Validate arguments before calling the constructor"],"tags":["null-argument","wpf","packaging","version"],"backgroundTag":"null-argument","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}