{"record":{"id":"129412ede5efd5a4","repo":"MahApps/MahApps.Metro","slug":"file-not-found-filename","errorCode":null,"errorMessage":"File not found: {fileName}","messagePattern":"File not found: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"build.cake","lineNumber":403,"sourceCode":"                        .AppendSwitchQuoted(\"--file-digest\", \"sha256\")\n                        .AppendSwitchQuoted(\"--description\", description)\n                        .AppendSwitchQuoted(\"--description-url\", \"https://github.com/MahApps/MahApps.Metro\")\n                        .Append(\"--no-page-hashing\")\n                        .AppendSwitchQuoted(\"--timestamp-rfc3161\", \"http://timestamp.digicert.com\")\n                        .AppendSwitchQuoted(\"--timestamp-digest\", \"sha256\")\n                        .AppendSwitchQuoted(\"--azure-key-vault-url\", vurl)\n                        .AppendSwitchQuotedSecret(\"--azure-key-vault-client-id\", vcid)\n                        .AppendSwitchQuotedSecret(\"--azure-key-vault-tenant-id\", vctid)\n                        .AppendSwitchQuotedSecret(\"--azure-key-vault-client-secret\", vcs)\n                        .AppendSwitchQuotedSecret(\"--azure-key-vault-certificate\", vc)\n                    );\n}\n\nvoid ExecuteProcess(FilePath fileName, ProcessArgumentBuilder arguments, string workingDirectory = null)\n{\n  if (!FileExists(fileName))\n  {\n    throw new Exception($\"File not found: {fileName}\");\n  }\n\n  var processSettings = new ProcessSettings\n  {\n    RedirectStandardOutput = true,\n    RedirectStandardError = true,\n    Arguments = arguments\n  };\n\n  if (!string.IsNullOrEmpty(workingDirectory))\n  {\n    processSettings.WorkingDirectory = workingDirectory;\n  }\n\n  Information($\"Arguments: {arguments.RenderSafe()}\");\n\n  using(var process = StartAndReturnProcess(fileName, processSettings))\n  {","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/MahApps/MahApps.Metro/blob/72099e310bac2d12ac98fd7560b69679252519f5/build.cake#L385-L421","documentation":"ExecuteProcess (build.cake:399) is the Cake helper that wraps every external tool invocation (e.g. XAML Styler, code signing). It first checks FileExists(fileName) and throws an Exception with the resolved path if the executable cannot be found. This fails the task before the process is ever started.","triggerScenarios":"Calling ExecuteProcess(styler, ...) when the styler tool path resolves to a non-existent file; calling SignFiles when the signing tool path is missing; any task that invokes an external binary whose path was not restored/downloaded.","commonSituations":"A required tool (e.g. XAMLStyler, the Azure signing tool, GitVersion) was not installed or its expected install path changed. The tool path variable was not set. A package restore step that downloads the tool was skipped or failed silently. Running on a fresh checkout without the ./tools restore step.","solutions":["Confirm the tool binary actually exists at the path printed in the message; if not, run the Cake tool-installing setup (the #tool directives / bootstrap) so tools are restored into ./tools.","Check the variable that computes fileName (e.g. styler tool resolution) and fix the directory or version it points to.","Run a clean restore target first (e.g. build.ps1 -Target Restore) before the target that needs the tool.","Verify the tool is compatible with the current OS/architecture (some tools are Windows-only)."],"exampleFix":"// before: tool path unresolved\nExecuteProcess(\"./tools/xamlstyler\", args);\n// after: ensure the #tool restore ran, then resolve explicitly\n#tool \"nuget:?package=XamlStyler&version=...\"\nvar styler = Context.Tools.Resolve(\"XamlStyler.exe\")\n    ?? throw new Exception(\"XamlStyler tool not restored; run -Target Restore\");\nExecuteProcess(styler, args);","handlingStrategy":"validation","validationCode":"// Resolve and validate the tool path before calling ExecuteProcess\nvar toolPath = Context.Tools.Resolve(\"XamlStyler.exe\");\nif (toolPath is null || !FileExists(toolPath)) {\n    throw new Exception($\"Tool not restored: run -Target Restore first. Expected XamlStyler.exe\");\n}\nExecuteProcess(toolPath, args);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run the tool-restore target (#tool directives / bootstrap) before targets that invoke external tools.","Pin tool versions in #tool nuget directives so restores are reproducible.","Use Cake's Context.Tools.Resolve(...) and assert non-null before invoking a process.","Document each external tool and the variable that locates it."],"tags":["build","cake","tooling","io","process"],"backgroundTag":null,"analyzedSha":"72099e310bac2d12ac98fd7560b69679252519f5","analyzedAt":"2026-08-13T20:19:34.419Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}