dotnet/BenchmarkDotNet · error · FileNotFoundException

Provided CoreRun path does not exist. Please remember that B

Error message

Provided CoreRun path does not exist. Please remember that BDN expects path to CoreRun.exe (corerun on Unix), not to Core_Root folder.

What it means

CoreRunToolchain validates the provided CoreRun FileInfo at construction; the file must exist and must be the executable itself, not the Core_Root folder that contains it.

Source

Thrown at src/BenchmarkDotNet/Toolchains/CoreRun/CoreRunToolchain.cs:26

    public class CoreRunToolchain : IToolchain
    {
        /// <summary>
        /// creates a CoreRunToolchain which is using provided CoreRun to execute .NET Core apps
        /// </summary>
        /// <param name="coreRun">the path to CoreRun</param>
        /// /<param name="createCopy">should a copy of CoreRun be performed? True by default. <remarks>The toolchain replaces old dependencies in CoreRun folder with newer versions if used by the benchmarks.</remarks></param>
        /// <param name="targetFrameworkMoniker">TFM, net10.0 is the default</param>
        /// <param name="customDotNetCliPath">path to dotnet cli, if not provided the one from PATH will be used</param>
        /// <param name="displayName">display name, CoreRun is the default value</param>
        /// <param name="restorePath">the directory to restore packages to</param>
        public CoreRunToolchain(FileInfo coreRun, bool createCopy = true,
            string targetFrameworkMoniker = "net10.0",
            FileInfo? customDotNetCliPath = null,
            DirectoryInfo? restorePath = null,
            string displayName = "CoreRun")
        {
            if (!coreRun.Exists)
                throw new FileNotFoundException("Provided CoreRun path does not exist. Please remember that BDN expects path to CoreRun.exe (corerun on Unix), not to Core_Root folder.");

            SourceCoreRun = coreRun;
            CopyCoreRun = createCopy ? GetShadowCopyPath(coreRun) : coreRun;
            CustomDotNetCliPath = customDotNetCliPath;
            RestorePath = restorePath;

            Name = displayName;
            Generator = new CoreRunGenerator(SourceCoreRun, CopyCoreRun, targetFrameworkMoniker, customDotNetCliPath?.FullName ?? "", restorePath?.FullName ?? "");
            Builder = new CoreRunPublisher(targetFrameworkMoniker, CopyCoreRun, customDotNetCliPath);
            Executor = new DotNetCliExecutor(customDotNetCliPath: CopyCoreRun.FullName); // instead of executing "dotnet $pathToDll" we do "CoreRun $pathToDll"
        }

        public string Name { get; }

        public IGenerator Generator { get; }

        public IBuilder Builder { get; }

View on GitHub (pinned to b515068b61)

Solutions

  1. Pass the full path to the CoreRun executable (CoreRun.exe on Windows, corerun on Unix), not the Core_Root directory.
  2. Verify the file exists at the path you configured, e.g. with Test-Path or ls.
  3. Build or download CoreRun for your runtime repo checkout and point CoreRunToolchain at that artifact.

When it happens

Trigger: Thrown at src/BenchmarkDotNet/Toolchains/CoreRun/CoreRunToolchain.cs:26 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dotnet/BenchmarkDotNet@b515068b61 (2026-08-13). Data as JSON: /api/errors/208f9036a6b9e3b8. Report an issue: GitHub.