{"record":{"id":"cc06e26291a0e7e9","repo":"CoplayDev/unity-mcp","slug":"package-was-not-found","errorCode":null,"errorMessage":"Package was not found","messagePattern":"Package was not found","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"TestProjects/AssetStoreUploads/Packages/com.unity.asset-store-tools/Editor/Validator/Scripts/ExternalProjectValidator.cs","lineNumber":29,"sourceCode":"namespace AssetStoreTools.Validator\r\n{\r\n    internal class ExternalProjectValidator : ValidatorBase\r\n    {\r\n        private ExternalProjectValidationSettings _settings;\r\n\r\n        public ExternalProjectValidator(ExternalProjectValidationSettings settings) : base(settings)\r\n        {\r\n            _settings = settings;\r\n        }\r\n\r\n        protected override void ValidateSettings()\r\n        {\r\n            if (_settings == null)\r\n                throw new Exception(\"Validation Settings is null\");\r\n\r\n            if (string.IsNullOrEmpty(_settings.PackagePath)\r\n                || !File.Exists(_settings.PackagePath))\r\n                throw new Exception(\"Package was not found\");\r\n        }\r\n\r\n        protected override ValidationResult GenerateValidationResult()\r\n        {\r\n            bool interactiveMode = false;\r\n            try\r\n            {\r\n                // Step 1 - prepare a temporary project\r\n                var result = PrepareTemporaryValidationProject(interactiveMode);\r\n\r\n                // If preparation was cancelled or setting up project failed - return immediately\r\n                if (result.Status == ValidationStatus.Cancelled || result.Status == ValidationStatus.Failed)\r\n                    return result;\r\n\r\n                // Step 2 - load the temporary project and validate the package\r\n                result = ValidateTemporaryValidationProject(result, interactiveMode);\r\n\r\n                // Step 3 - copy validation results\r","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/TestProjects/AssetStoreUploads/Packages/com.unity.asset-store-tools/Editor/Validator/Scripts/ExternalProjectValidator.cs#L11-L47","documentation":"Thrown by ExternalProjectValidator.ValidateSettings when PackagePath is null/empty or the file does not exist (File.Exists false). The external validator operates on a single .unitypackage file, so it requires a concrete file path before preparing its temporary validation project.","triggerScenarios":"Constructing ExternalProjectValidator with settings whose PackagePath is unset, empty, or points to a non-existent file; passing a directory instead of a file; or referencing a package that was deleted after selection.","commonSituations":"The .unitypackage was built to a different output location, a build step failed silently so the file is missing, or the path was cleared in the settings asset. Common when automating validation with a computed output path.","solutions":["Set _settings.PackagePath to the absolute path of an existing .unitypackage file.","Verify File.Exists(_settings.PackagePath) before constructing the validator.","Ensure the package-export step completes successfully before the validation step runs."],"exampleFix":"// before\nsettings.PackagePath = exportDir;\n// after\nsettings.PackagePath = Path.Combine(exportDir, \"MyPackage.unitypackage\");","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(settings.PackagePath) || !File.Exists(settings.PackagePath))\n    throw new Exception(\"PackagePath must be an existing .unitypackage file\");","typeGuard":"static bool HasValidPackagePath(ExternalProjectValidationSettings s) =>\n    !string.IsNullOrEmpty(s?.PackagePath) && File.Exists(s.PackagePath);","tryCatchPattern":"try { validator.ValidateSettings(); }\ncatch (Exception ex) when (ex.Message.Contains(\"Package was not found\")) { ... }","preventionTips":["Verify the export step produced the .unitypackage before validating.","Store absolute paths to avoid working-directory ambiguity."],"tags":["csharp","unity","asset-store","validator","validation"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}