dotnet/reactive · error · ArgumentException

Unsupported host runtime TFM

Error message

Unsupported host runtime TFM: {hostRuntimeTfm}

What it means

PlugInHost.Run decides which host executable (PlugIn.HostNetFx, etc.) launches the plug-in based on the host runtime TFM; unrecognized TFMs cause ArgumentException 'Unsupported host runtime TFM'. The set of supported TFMs is fixed in code.

Solutions

  1. Pass a supported TFM (e.g. net45, net46, netcoreapp as wired in the switch)
  2. Update PlugInHost.cs to map the new TFM to the appropriate launcher and rebuild
  3. Normalize/trim the TFM string before calling Run

Example fix

// before
await host.Run("net8.0"); // not mapped
// after
// add a case for net8.0 in PlugInHost.Run mapping to the .NET (Core) launcher, or use a supported TFM:
await host.Run("net6.0");
Defensive patterns

Strategy: validation

Validate before calling

var supported = new[] { /* TFMs mapped in PlugInHost.Run */ };
if (!supported.Contains(hostRuntimeTfm)) throw new ArgumentException($"Unsupported host runtime TFM: {hostRuntimeTfm}");

Try / catch

try { await host.Run(hostRuntimeTfm); }
catch (ArgumentException ex) when (ex.Message.StartsWith("Unsupported host runtime TFM")) { /* correct TFM or extend mapping */ }

Prevention

When it happens

Trigger: Invoking the Gauntlet plug-in checks with hostRuntimeTfm values like net48, netcoreapp3.1, net5.0 or custom monikers that the switch statement doesn't map to a launcher.

Common situations: Adding a new .NET version to the Gauntlet matrix without updating PlugInHost, passing a TFM string with wrong casing or a 'v' prefix, or running checks from a differently-configured build script.

Related errors


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

Appendix: source

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

    {
        string launcher;

        if (hostRuntimeTfm.StartsWith("net"))
        {
            if (hostRuntimeTfm.Contains('.'))
            {
                // .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,

View on GitHub (pinned to 94b5d5ab91)