{"record":{"id":"d008dd3c088493a0","repo":"peass-ng/PEASS-ng","slug":"collection-is-readonly","errorCode":null,"errorMessage":"Collection is readonly.","messagePattern":"Collection is readonly\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/RehashableDictionary.cs","lineNumber":423,"sourceCode":"            {\n                Dictionary.Added -= DictionaryChanged;\n                Dictionary.Removed -= DictionaryChanged;\n            }\n            void DictionaryChanged(object sender, RehashableDictionary<K, V>.DictionaryEventArgs e)\n            {\n                Invalid = true;\n            }\n\n            protected void CheckValid()\n            {\n                if ( Invalid )\n                    throw new InvalidOperationException(\n                        \"Dictionary was modified after this collection was created.\");\n            }\n\n            static void ThrowReadOnlyError()\n            {\n                throw new InvalidOperationException(\"Collection is readonly.\");\n            }\n\n            #region ICollection<K> メンバ\n\n            public void Add(T item)\n            { ThrowReadOnlyError(); }\n\n            public void Clear()\n            { ThrowReadOnlyError(); }\n\n            public abstract bool Contains(T item);\n\n            public abstract void CopyTo(T[] array, int arrayIndex);\n\n            public virtual int Count\n            { get { return Dictionary.Count; } }\n\n            public bool IsReadOnly","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/RehashableDictionary.cs#L405-L441","documentation":"A shared throw helper (ThrowReadOnlyError) used by the Add, Clear and Remove mutators of RehashableDictionary's read-only view: the wrapper object represents a read-only projection of the dictionary, so any state-changing operation is rejected with this InvalidOperationException before touching the underlying store.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/RehashableDictionary.cs:423 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Mutate the underlying RehashableDictionary directly instead of its read-only view","Create a writable copy (new dictionary from the view) if local mutation is needed","Query IsReadOnly before calling mutators and skip/handle accordingly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}