microsoft/aspire · error · InvalidOperationException

Integration package probe manifest path is invalid.

Error message

Integration package probe manifest path is invalid.

What it means

NormalizePath wraps Path.GetFullPath for probe-manifest path values and converts argument-level failures (ArgumentException, NotSupportedException, PathTooLongException) into an InvalidOperationException carrying the configured 'invalid path' message. It indicates the path string itself is malformed, not that a file is missing.

Solutions

  1. Inspect the raw path value in the manifest and remove invalid characters or empty segments.
  2. Use Path.Combine with valid segments instead of string concatenation to build the path.
  3. On Windows, enable long paths (LongPathsEnabled registry and longPathAware) if the path exceeds 260 characters.
  4. Check the inner exception (ArgumentException) for the exact character or position that is invalid.

Example fix

// before
var path = manifestDir + null + "lib.so"; // malformed

// after
var path = Path.Combine(manifestDir, "native", "lib.so");
Defensive patterns

Strategy: validation

Validate before calling

if (string.IsNullOrWhiteSpace(candidate) || candidate.IndexOfAny(Path.GetInvalidPathChars()) >= 0)
    throw new ArgumentException($"Invalid path: {candidate}");

Try / catch

try { Path.GetFullPath(raw); }
catch (Exception ex) when (ex is ArgumentException or PathTooLongException or NotSupportedException)
{ logger.LogError(ex, "Cannot normalize probe manifest path: {Raw}", raw); throw; }

Prevention

When it happens

Trigger: Any manifest path (the manifest file path itself via NormalizeManifestPath, or an entry path) that Path.GetFullPath rejects: null/empty after trimming, illegal characters, or paths exceeding length limits.

Common situations: Empty path property in a manifest JSON that slipped past other checks; path containing invalid Windows characters (quotes, colons); extremely long paths on Windows without long-path support; paths built by concatenating null segments.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16). Data as JSON: /api/errors/ef2da779599dcea0. Report an issue: GitHub.

Appendix: source

Thrown at src/Shared/IntegrationPackageProbeManifest.cs:362

        }

        return normalizedPath;
    }

    private static string NormalizeManifestPath(string manifestPath)
    {
        return NormalizePath(manifestPath, "Integration package probe manifest path is invalid.");
    }

    private static string NormalizePath(string path, string invalidPathMessage)
    {
        try
        {
            return Path.GetFullPath(path);
        }
        catch (Exception ex) when (ex is ArgumentException or NotSupportedException or PathTooLongException)
        {
            throw new InvalidOperationException(invalidPathMessage, ex);
        }
    }

    private static string? NormalizeCulture(string? culture)
    {
        return string.IsNullOrWhiteSpace(culture) || string.Equals(culture, "neutral", StringComparison.OrdinalIgnoreCase)
            ? null
            : culture.Trim();
    }

    private static string NormalizeRequiredValue(string? value, string propertyName)
    {
        if (string.IsNullOrWhiteSpace(value))
        {
            throw new InvalidOperationException($"Integration package probe manifest entry is missing required property '{propertyName}'.");
        }

        return value.Trim();

View on GitHub (pinned to 25830f84bd)