{"record":{"id":"e7fed2cd1cdccc87","repo":"stride3d/stride","slug":"two-bundles-with-name-0-found","errorCode":null,"errorMessage":"Two bundles with name {0} found","messagePattern":"Two bundles with name (.+?) found","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.AssetCompiler/BundlePacker.cs","lineNumber":87,"sourceCode":"                                    pathSelector.Paths[i] = \"/\" + assetNamespace + path;\n                            }\n                        }\n                    }\n                    bundles.AddRange(project.Bundles);\n                }\n\n                var databaseFileProvider = new DatabaseFileProvider(objDatabase.ContentIndexMap, objDatabase);\n\n                // Fail early with a clear error if any reference was left bare instead of rooted.\n                ValidateReferenceRooting(logger, databaseFileProvider, assetNamespaces);\n\n                // Pass1: Create ResolvedBundle from user Bundle\n                var resolvedBundles = new Dictionary<string, ResolvedBundle>();\n                foreach (var bundle in bundles)\n                {\n                    if (resolvedBundles.ContainsKey(bundle.Name))\n                    {\n                        throw new InvalidOperationException(string.Format(\"Two bundles with name {0} found\", bundle.Name));\n                    }\n\n                    resolvedBundles.Add(bundle.Name, new ResolvedBundle(bundle));\n                }\n\n                // Pass2: Enumerate all assets which directly or indirectly belong to an bundle\n                var bundleAssets = new HashSet<string>();\n\n                foreach (var bundle in resolvedBundles)\n                {\n                    // For each project, we apply asset selectors of current bundle\n                    // This will give us a list of \"root assets\".\n                    foreach (var assetSelector in bundle.Value.Source.Selectors)\n                    {\n                        foreach (var assetLocation in assetSelector.Select(packageSession, objDatabase.ContentIndexMap))\n                        {\n                            bundle.Value.AssetUrls.Add(assetLocation);\n                        }","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.AssetCompiler/BundlePacker.cs#L69-L105","documentation":"ObjectNode.Add supports collections and dictionaries; when the node's Descriptor is neither a CollectionDescriptor nor a DictionaryDescriptor, the value cannot be added and a NotSupportedException is thrown. This is a guard against calling Add on node types (plain objects, sets, unsupported collections) that have no defined add semantics.","triggerScenarios":"Calling ObjectNode.Add(value, index) on a node whose Descriptor is not a CollectionDescriptor or DictionaryDescriptor — e.g. a set, an array, a non-collection property, or a custom collection the descriptor system does not recognize.","commonSituations":"Binding a UI editor or property grid to a node backed by a set or fixed-size array and then invoking Add from 'add item' UI commands; reflection/undo-redo code assuming every collection node supports Add.","solutions":["Check the node's Descriptor type before calling Add: only call Add when descriptor is CollectionDescriptor or DictionaryDescriptor.","For sets, use the set-specific API (SetDescriptor) instead of Add.","For fixed-size structures like arrays, replace the whole value via Update/SetValue rather than adding items."],"exampleFix":"// before\nnode.Add(newItem, NodeIndex.Empty);\n// after\nif (node.Descriptor is CollectionDescriptor || node.Descriptor is DictionaryDescriptor)\n    node.Add(newItem, NodeIndex.Empty);","handlingStrategy":"validation","validationCode":"bool canAdd = node.Descriptor is CollectionDescriptor or DictionaryDescriptor;\nif (!canAdd) throw new InvalidOperationException($\"Cannot Add on node of type {node.Descriptor?.GetType().Name}\");","typeGuard":"bool IsAddableCollection(ObjectNode node) => node.Descriptor is CollectionDescriptor or DictionaryDescriptor;","tryCatchPattern":"try { node.Add(value, index); }\ncatch (NotSupportedException ex) { /* fall back to whole-value update or surface unsupported-collection state */ }","preventionTips":["Check Descriptor type before mutating collection nodes","Never call Add on set- or array-backed nodes","Centralize node mutation in helpers that dispatch on descriptor kind"],"tags":["unsupported-collection","quantum","not-supported"],"backgroundTag":"unsupported-operation","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}