{"record":{"id":"c47188338c7d7f0f","repo":"stride3d/stride","slug":"the-provided-path-is-not-a-valid-path-name","errorCode":null,"errorMessage":"The provided path is not a valid path name.","messagePattern":"The provided path is not a valid path name\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.AssetCompiler/PackageBuilderOptions.cs","lineNumber":89,"sourceCode":"\n        /// <summary>\n        /// Ensure every parameter is correct for a master execution. Throw an OptionException if a parameter is wrong\n        /// </summary>\n        /// <exception cref=\"Mono.Options.OptionException\">This tool requires one input file.;filename\n        /// or\n        /// The given working directory \\ + workingDir + \\ does not exist.;workingdir</exception>\n        public void ValidateOptions()\n        {\n            if (string.IsNullOrWhiteSpace(BuildDirectory))\n                throw new ArgumentException(\"This tool requires a build path.\", \"build-path\");\n\n            try\n            {\n                BuildDirectory = Path.GetFullPath(BuildDirectory);\n            }\n            catch (Exception)\n            {\n                throw new ArgumentException(\"The provided path is not a valid path name.\", \"build-path\");\n            }\n\n            if (SlavePipe == null)\n            {\n                if (!string.IsNullOrWhiteSpace(PackageManifestFile))\n                {\n                    if (!File.Exists(PackageManifestFile))\n                        throw new ArgumentException(\"Build manifest [{0}] doesn't exist\".ToFormat(PackageManifestFile), \"packageManifestFile\");\n                }\n                else if (string.IsNullOrWhiteSpace(PackageFile))\n                {\n                    if (string.IsNullOrWhiteSpace(SolutionFile) || PackageId == Guid.Empty)\n                    {\n                        throw new ArgumentException(\"This tool requires an input file (package, project, or .sdbuild manifest), or a --solution-file and --package-id.\", \"inputPackageFile\");\n                    }\n                }\n                else if (!File.Exists(PackageFile))\n                {","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.AssetCompiler/PackageBuilderOptions.cs#L71-L107","documentation":"PackageBuilderOptions.ValidateOptions throws this ArgumentException when Path.GetFullPath(BuildDirectory) fails, which happens only when the BuildDirectory string is not a syntactically valid path (e.g. contains invalid characters or is malformed). It is a fail-fast guard so the build tool never runs with a broken output directory. The ArgumentException parameter name 'build-path' identifies the offending CLI option.","triggerScenarios":"Running the Stride asset build tool (PackageBuilder) with a --build-path / BuildDirectory value that Path.GetFullPath cannot resolve, such as a string containing illegal filesystem characters, or an empty/whitespace-only value that was not caught earlier.","commonSituations":"Shell quoting issues injecting stray characters into --build-path; environment-specific illegal characters (e.g. '<', '|', ':' on Windows); build scripts concatenating variables that produce a malformed path; forgetting to set build directory in CI configuration.","solutions":["Print and inspect the --build-path value actually received by the tool; fix quoting or variable expansion in the invoking script","Remove illegal filesystem characters from the path or provide a simpler absolute path","Omit --build-path if the tool supports a default so a valid default is used","Wrap validation: call Path.GetFullPath on the value yourself before invoking the tool to get a clearer error"],"exampleFix":"// before\n--build-path=\"out|put\"\n// after\n--build-path=\"C:\\build\\output\"","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(buildDirectory) || buildDirectory.IndexOfAny(Path.GetInvalidPathChars()) >= 0)\n    throw new ArgumentException($\"Invalid build path: '{buildDirectory}'\", nameof(buildDirectory));\nvar fullPath = Path.GetFullPath(buildDirectory); // throws same way before invoking the tool","typeGuard":null,"tryCatchPattern":"try { Path.GetFullPath(buildDirectory); } catch (Exception ex) { Console.Error.WriteLine($\"--build-path is not a valid path: {buildDirectory}\"); return 1; }","preventionTips":["Validate --build-path with Path.GetFullPath in the invoking script before running the tool","Quote path arguments carefully in shell scripts","Avoid characters illegal on the target filesystem"],"tags":["dotnet","paths","validation","cli"],"backgroundTag":"invalid-path-format","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"}