Devolutions/UniGetUI · error · InvalidOperationException

No package manager matching "{managerName}" was found.

Error message

No package manager matching "{managerName}" was found.

What it means

Thrown by ResolveManagers when a specific managerName was provided (non-whitespace) but no manager's Id matches it case-insensitively via MatchesManagerId. Note: MatchesManagerId only compares manager.Id — it does NOT check manager.Name or DisplayName, unlike ResolveImportedManager which checks all three.

Source

Thrown at src/UniGetUI.Interface.IpcApi/IpcManagerSettingsApi.cs:340

            Message = operation.Status switch
            {
                OperationStatus.Succeeded => null,
                OperationStatus.Canceled => "The operation was canceled.",
                _ => operation.GetOutput().LastOrDefault().Item1,
            },
            Source = ToSourceInfo(source, isKnown: true, isConfigured: true),
        };
    }

    internal static IReadOnlyList<IPackageManager> ResolveManagers(string? managerName)
    {
        var managers = PEInterface.Managers
            .Where(manager => MatchesManagerId(manager, managerName))
            .ToArray();

        if (managers.Length == 0)
        {
            throw new InvalidOperationException(
                string.IsNullOrWhiteSpace(managerName)
                    ? "No package managers are available."
                    : $"No package manager matching \"{managerName}\" was found."
            );
        }

        return managers;
    }

    internal static IPackageManager ResolveManager(string managerName)
    {
        if (string.IsNullOrWhiteSpace(managerName))
        {
            throw new InvalidOperationException("The manager parameter is required.");
        }

        return ResolveManagers(managerName).First();
    }

View on GitHub (pinned to 9b1d7d0eab)

Solutions

  1. Use the exact manager Id — call ListManagers() to see valid Id values.
  2. If matching by Name or DisplayName is needed, use ResolveImportedManager which checks all three fields.
  3. Check for typos or casing issues — matching is case-insensitive but otherwise exact on the Id field.

Example fix

// before — using Display name instead of Id
var sources = IpcManagerSettingsApi.ListSources("Windows Package Manager");
// after
var managers = IpcManagerSettingsApi.ListManagers();
var wingetId = managers.First(m => m.Name == "WinGet").Name; // or use the actual Id
var sources = IpcManagerSettingsApi.ListSources(wingetId);
Defensive patterns

Strategy: validation

Validate before calling

var validIds = IpcManagerSettingsApi.ListManagers().Select(m => m.Name).ToHashSet(StringComparer.OrdinalIgnoreCase);
if (!string.IsNullOrWhiteSpace(managerName) && !validIds.Contains(managerName))
    throw new ArgumentException($"Unknown manager: {managerName}. Valid: {string.Join(", ", validIds)}");

Prevention

When it happens

Trigger: Calling any API path through ResolveManagers (e.g., ListSources) with a managerName that does not match any manager's Id property. Using the manager's DisplayName or Name instead of its Id will fail here, since only Id is checked.

Common situations: Using a human-readable name like 'Winget' when the Id is 'winget' (case sensitivity is handled, but a completely different string won't match). Using a manager Name ('WinGet') when the API expects the Id (which may differ). Typo in the manager name string.

Related errors


AI-assisted analysis of Devolutions/UniGetUI@9b1d7d0eab (2026-08-13). Data as JSON: /api/errors/8ff3ddd06639d108. Report an issue: GitHub.