dotnet/reactive · error · DirectoryNotFoundException

PlugIns folder not found

Error message

PlugIns folder not found: {plugInsFolder.FullName}

What it means

PlugInHost.Run expects the plug-ins folder to sit a fixed relative distance (../../../../) from the host driver's base directory; if that directory doesn't exist it throws DirectoryNotFoundException 'PlugIns folder not found'.

Solutions

  1. Build and run the driver via the standard solution layout so the ../../../../ path resolves to the plug-ins folder
  2. Pass a correct/overridable plug-ins path or update PlugInHost to compute it from the solution root
  3. Verify the directory exists at the resolved path before running

Example fix

// before
dotnet PlugIn.HostDriver/bin/Debug/net6.0/PlugIn.HostDriver.dll  // run from odd location
// after
// run from the expected build layout, or set the plug-ins root explicitly in PlugInHost
DirectoryInfo plugInsFolder = new(Path.Combine(AppContext.BaseDirectory, plugInsRootOverride ?? "../../../../"));
Defensive patterns

Strategy: validation

Validate before calling

var plugIns = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../../"));
if (!Directory.Exists(plugIns)) throw new DirectoryNotFoundException($"PlugIns folder not found: {plugIns}");

Try / catch

try { await host.Run(tfm); }
catch (DirectoryNotFoundException ex) when (ex.Message.Contains("PlugIns folder not found")) { /* run from standard layout or fix path override */ }

Prevention

When it happens

Trigger: Running the PlugIn.HostDriver from a location where four directories up is not the repository's plug-ins root (different output layout, published/single-folder deploy, custom output path).

Common situations: Running the driver from a different working directory or build configuration, moving the host binary, or CI checkouts with different depth/paths than the assumed relative layout.

Related errors


AI-assisted analysis of dotnet/reactive@94b5d5ab91 (2026-09-15). Data as JSON: /api/errors/531836cb73eed63b. Report an issue: GitHub.

Appendix: source

Thrown at Rx.NET/Test/Gauntlet/Checks/PlugIns/PlugIn.HostDriver/PlugInHost.cs:94

                // .NET Core or .NET 5+
                launcher = "PlugIn.HostDotnet";
            }
            else
            {
                // .NET Framework
                launcher = "PlugIn.HostNetFx";
            }
        }
        else
        {
            throw new ArgumentException($"Unsupported host runtime TFM: {hostRuntimeTfm}");
        }

        DirectoryInfo plugInsFolder = new(
            Path.Combine(AppContext.BaseDirectory, "../../../../"));
        if (!plugInsFolder.Exists)
        {
            throw new DirectoryNotFoundException($"PlugIns folder not found: {plugInsFolder.FullName}");
        }

        var plugInHostProjectFolder = Path.Combine(
            plugInsFolder.FullName,
            launcher);
        if (!Directory.Exists(plugInHostProjectFolder))
        {
            throw new DirectoryNotFoundException($"PlugIn host project folder not found at {plugInHostProjectFolder}");
        }
        var plugInHostExecutableFolder = Path.Combine(
            plugInHostProjectFolder,
            $"bin/{Configuration}/{hostRuntimeTfm}/");
        if (!Directory.Exists(plugInHostExecutableFolder))
        {
            throw new DirectoryNotFoundException($"PlugIn host build output folder not found at {plugInHostExecutableFolder}");
        }

        var plugInHostExecutablePath = Path.Combine(

View on GitHub (pinned to 94b5d5ab91)