{"record":{"id":"b9e3ed31066c2834","repo":"peass-ng/PEASS-ng","slug":"multi-dimensional-arrays-are-not-supported-b9e3ed","errorCode":null,"errorMessage":"Multi-dimensional arrays are not supported.","messagePattern":"Multi-dimensional arrays are not supported\\.","errorType":"exception","errorClass":"RankException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/TaskScheduler/TriggerCollection.cs","lineNumber":449,"sourceCode":"            if (Count > 1)\n                return Properties.Resources.MultipleTriggers;\n            return string.Empty;\n        }\n\n        void ICollection<Trigger>.Add(Trigger item) => Add(item);\n\n        int IList.Add(object value)\n        {\n            Add((Trigger)value);\n            return Count - 1;\n        }\n\n        bool IList.Contains(object value) => Contains((Trigger)value);\n\n        void ICollection.CopyTo(Array array, int index)\n        {\n            if (array != null && array.Rank != 1)\n                throw new RankException(\"Multi-dimensional arrays are not supported.\");\n            var src = new Trigger[Count];\n            CopyTo(src, 0);\n            Array.Copy(src, 0, array, index, Count);\n        }\n\n        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n\n        System.Xml.Schema.XmlSchema IXmlSerializable.GetSchema() => null;\n\n        int IList.IndexOf(object value) => IndexOf((Trigger)value);\n\n        void IList.Insert(int index, object value) => Insert(index, (Trigger)value);\n\n        void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)\n        {\n            reader.ReadStartElement(XmlSerializationHelper.GetElementName(this), TaskDefinition.tns);\n            while (reader.MoveToContent() == System.Xml.XmlNodeType.Element)\n            {","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/TaskScheduler/TriggerCollection.cs#L431-L467","documentation":"Rank guard in the non-generic ICollection.CopyTo implementation of TriggerCollection: the destination Array has Rank != 1 (a multi-dimensional array), which the copy loop cannot fill, so RankException is thrown before any copying. The faulting input is the array argument's shape; a null array is handled separately by the standard null check.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/TriggerCollection.cs:449 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a one-dimensional (rank-1) Trigger[] as the destination array","Cast to the generic ICollection<Trigger> and use CopyTo(Trigger[], int), which gives compile-time dimension safety"],"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"}