{"record":{"id":"8cf32dbb9e29650f","repo":"stride3d/stride","slug":"cannot-delete-a-mountpointviewmodel","errorCode":null,"errorMessage":"Cannot delete a MountPointViewModel","messagePattern":"Cannot delete a MountPointViewModel","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/editor/Stride.Core.Assets.Editor/ViewModel/MountPointViewModel.cs","lineNumber":41,"sourceCode":"\n        public override PackageViewModel Package { get; }\n\n        /// <inheritdoc/>\n        public override string TypeDisplayName => \"Mount Point\";\n\n        /// <inheritdoc/>\n        public override IEnumerable<IDirtiable> Dirtiables => base.Dirtiables.Concat(Package.Dirtiables);\n\n        public IReadOnlyCollection<DirectoryBaseViewModel> GetDirectoryHierarchy()\n        {\n            var hierarchy = new List<DirectoryBaseViewModel>();\n            GetDirectoryHierarchy(hierarchy);\n            return hierarchy;\n        }\n\n        public override void Delete()\n        {\n            throw new NotSupportedException(\"Cannot delete a MountPointViewModel\");\n        }\n\n        public abstract bool AcceptAssetType(Type assetType);\n\n        protected override void UpdateIsDeletedStatus()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n","sourceCodeStart":23,"sourceCodeEnd":52,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/editor/Stride.Core.Assets.Editor/ViewModel/MountPointViewModel.cs#L23-L52","documentation":"MountPointViewModel.Delete overrides the deletable-directory contract and throws NotSupportedException: the mount point is the structural root of a package's asset tree and cannot be deleted like a folder.","triggerScenarios":"Calling Delete() on a MountPointViewModel directly, or via bulk operations (e.g. DeleteSelectedSolutionItems) that include the mount point in the selection.","commonSituations":"Select-all in the session explorer followed by delete; scripts enumerating tree nodes and deleting each one.","solutions":["Filter MountPointViewModel nodes out of delete operations","Only call Delete on DirectoryViewModel/AssetViewModel nodes","Handle or filter NotSupportedException in bulk delete loops"],"exampleFix":"// before\nforeach (var node in selectedNodes) node.Delete();\n// after\nforeach (var node in selectedNodes.OfType<DirectoryViewModel>()) node.Delete();","handlingStrategy":"type-guard","validationCode":"if (node is MountPointViewModel) throw new ArgumentException(\"Mount points cannot be deleted\");","typeGuard":"bool CanDelete(DirectoryBaseViewModel n) => n is not MountPointViewModel;","tryCatchPattern":"try { node.Delete(); } catch (NotSupportedException) { /* not deletable */ }","preventionTips":["Filter mount points from delete selections","Use OfType<DirectoryViewModel>() in bulk deletes","Catch NotSupportedException in bulk loops"],"tags":["viewmodel","mount-point","delete"],"backgroundTag":"operation-not-supported","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}