{"record":{"id":"396a7bb15d9dee06","repo":"CoplayDev/unity-mcp","slug":"the-following-directories-do-not-exist","errorCode":null,"errorMessage":"The following directories do not exist:","messagePattern":"The following directories do not exist:","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"TestProjects/AssetStoreUploads/Packages/com.unity.asset-store-tools/Editor/Validator/Scripts/CurrentProjectValidator.cs","lineNumber":47,"sourceCode":"                case ValidationType.UnityPackage:\r\n                    ValidateUnityPackageSettings();\r\n                    break;\r\n                default:\r\n                    throw new NotImplementedException(\"Undefined validation type\");\r\n            }\r\n        }\r\n\r\n        private void ValidateUnityPackageSettings()\r\n        {\r\n            var invalidPaths = string.Empty;\r\n            foreach (var path in _settings.ValidationPaths)\r\n            {\r\n                if (!Directory.Exists(path))\r\n                    invalidPaths += $\"\\n{path}\";\r\n            }\r\n\r\n            if (!string.IsNullOrEmpty(invalidPaths))\r\n                throw new Exception(\"The following directories do not exist:\" + invalidPaths);\r\n        }\r\n\r\n        protected override ValidationResult GenerateValidationResult()\r\n        {\r\n            ITestConfig config;\r\n            var applicableTests = GetApplicableTests(ValidationType.Generic);\r\n            switch (_settings.ValidationType)\r\n            {\r\n                case ValidationType.Generic:\r\n                    config = new GenericTestConfig() { ValidationPaths = _settings.ValidationPaths.ToArray() };\r\n                    break;\r\n                case ValidationType.UnityPackage:\r\n                    applicableTests.AddRange(GetApplicableTests(ValidationType.UnityPackage));\r\n                    config = new GenericTestConfig() { ValidationPaths = _settings.ValidationPaths.ToArray() };\r\n                    break;\r\n                default:\r\n                    return new ValidationResult() { Status = ValidationStatus.Failed, Exception = new Exception(\"Undefined validation type\") };\r\n            }\r","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/TestProjects/AssetStoreUploads/Packages/com.unity.asset-store-tools/Editor/Validator/Scripts/CurrentProjectValidator.cs#L29-L65","documentation":"Thrown by CurrentProjectValidator.ValidateUnityPackageSettings when one or more entries in ValidationPaths do not exist on disk (Directory.Exists returns false). The message appends every invalid path. This runs only after the null/empty check (error 144) passes, so it indicates paths were supplied but are wrong.","triggerScenarios":"Running UnityPackage/Generic validation where at least one ValidationPaths entry points to a non-existent folder; a path that is a file rather than a directory; or a path whose parent was moved/deleted.","commonSituations":"Folders renamed or moved after validation settings were saved; relative paths resolved against an unexpected working directory; or a developer typed a path that does not match the project layout.","solutions":["Cross-check each ValidationPaths entry with Directory.Exists and remove/fix the offenders.","Use paths relative to Application.dataPath (the Assets folder) for stability.","Re-open the validation settings UI and re-pick the folders if assets were reorganized."],"exampleFix":"// before\nsettings.ValidationPaths = new List<string> { \"Assets/OldFolder\" };\n// after\nsettings.ValidationPaths = new List<string> { \"Assets/RenamedFolder\" };","handlingStrategy":"validation","validationCode":"var missing = settings.ValidationPaths.Where(p => !Directory.Exists(p)).ToList();\nif (missing.Count > 0)\n    throw new Exception(\"Missing: \" + string.Join(\", \", missing));","typeGuard":"static bool AllPathsExist(IEnumerable<string> paths) =>\n    paths.All(Directory.Exists);","tryCatchPattern":"try { validator.ValidateSettings(); }\ncatch (Exception ex) when (ex.Message.Contains(\"do not exist\")) { /* fix paths */ }","preventionTips":["Prefer paths relative to Application.dataPath.","Re-pick folders in the UI after reorganizing assets."],"tags":["csharp","unity","asset-store","validator","filesystem","validation"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}