{"record":{"id":"adb79d3a6748b2a2","repo":"dotnet/BenchmarkDotNet","slug":"given-file-does-not-exist","errorCode":null,"errorMessage":"Given file does not exist","messagePattern":"Given file does not exist","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"src/BenchmarkDotNet/Toolchains/DotNetCli/CustomDotNetCliToolchainBuilder.cs","lineNumber":75,"sourceCode":"            return this;\n        }\n\n        protected string GetTargetFrameworkMoniker()\n        {\n            if (targetFrameworkMoniker.IsNotBlank())\n                return targetFrameworkMoniker;\n            if (!Portability.RuntimeInformation.IsNetCore)\n                throw new NotSupportedException(\"You must specify the target framework moniker in explicit way using builder.TargetFrameworkMoniker(tfm) method\");\n\n            return CoreRuntime.GetCurrentVersion().MsBuildMoniker;\n        }\n\n        /// <param name=\"newCustomDotNetCliPath\">if not provided, the one from PATH will be used</param>\n        [PublicAPI]\n        public CustomDotNetCliToolchainBuilder DotNetCli(string newCustomDotNetCliPath)\n        {\n            if (newCustomDotNetCliPath.IsNotBlank() && !File.Exists(newCustomDotNetCliPath))\n                throw new FileNotFoundException(\"Given file does not exist\", newCustomDotNetCliPath);\n\n            customDotNetCliPath = newCustomDotNetCliPath;\n\n            return this;\n        }\n\n        /// <param name=\"newRuntimeIdentifier\">if not provided, portable OS-arch will be used (example: \"win-x64\", \"linux-x86\")</param>\n        [PublicAPI]\n        public CustomDotNetCliToolchainBuilder RuntimeIdentifier(string newRuntimeIdentifier)\n        {\n            runtimeIdentifier = newRuntimeIdentifier;\n\n            return this;\n        }\n\n        /// <param name=\"newRuntimeFrameworkVersion\">optional, when set it's copied to the generated .csproj file</param>\n        [PublicAPI]\n        public CustomDotNetCliToolchainBuilder RuntimeFrameworkVersion(string newRuntimeFrameworkVersion)","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/dotnet/BenchmarkDotNet/blob/b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3/src/BenchmarkDotNet/Toolchains/DotNetCli/CustomDotNetCliToolchainBuilder.cs#L57-L93","documentation":"CustomDotNetCliToolchainBuilder.DotNetCli checks that a provided custom dotnet CLI path exists on disk and throws FileNotFoundException when it does not.","triggerScenarios":"Thrown at src/BenchmarkDotNet/Toolchains/DotNetCli/CustomDotNetCliToolchainBuilder.cs:75 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the path passed to DotNetCli() points to an existing dotnet executable (dotnet or dotnet.exe).","Omit the custom path so the dotnet CLI from PATH is used instead.","Check for typos, and use an absolute path."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3","analyzedAt":"2026-08-13T19:12:24.196Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}