microsoft/aspire · error · RadiusUnresolvableValueException
the endpoint ' ' is not defined on resource
Error message
the endpoint '${endpointReference.EndpointName}' is not defined on resource '${endpointReference.Resource.Name}' What it means
An EndpointReference points to an endpoint name that does not exist on the referenced resource. During Radius publishing the publisher verifies endpoint existence before emitting connection values and throws RadiusUnresolvableValueException when EndpointReference.Exists is false.
Solutions
- Correct the endpoint name in the EndpointReference to match an endpoint defined on the resource.
- Define the endpoint on the resource with WithEndpoint/WithHttpEndpoint using the referenced name.
- Check that the endpoint isn't added under a condition that doesn't hold in publish mode.
- Verify the EndpointReference targets the right resource instance.
Example fix
// before
var ep = cache.GetEndpoint("redis"); // no 'redis' endpoint defined
// after
cache.WithEndpoint(targetPort: 6379, name: "redis");
var ep = cache.GetEndpoint("redis"); Defensive patterns
Strategy: validation
Validate before calling
var ep = resource.GetEndpoint(name);
if (!ep.Exists)
throw new InvalidOperationException($"Endpoint '{name}' must be defined (WithEndpoint) before use."); Type guard
static bool EndpointExists(IResource r, string name) =>
r.Annotations.OfType<EndpointAnnotation>().Any(e => string.Equals(e.Name, name, StringComparison.OrdinalIgnoreCase)); Try / catch
try { BuildEndpointValue(ep); }
catch (RadiusUnresolvableValueException ex) when (ex.Message.Contains("is not defined on resource"))
{ log.LogError(ex, "Missing endpoint; add WithEndpoint for '{Endpoint}'.", ep.EndpointName); } Prevention
- Always define endpoints with WithEndpoint/WithHttpEndpoint before referencing them.
- Use constants for endpoint names to avoid typos.
- Check for conditional endpoint registration that may not apply in publish mode.
- Validate endpoint references in unit tests against the resource model.
When it happens
Trigger: Calling GetEndpoint("name") on a resource that never defines that endpoint (no WithEndpoint/WithHttpEndpoint with that name) and then using that EndpointReference in a value published to Radius.
Common situations: Typo in the endpoint name; endpoint added conditionally (e.g. only in Run mode) so publish-mode model lacks it; endpoint defined on a different resource than intended; refactoring renamed the endpoint.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- A ConfigureRadiusInfrastructure callback removed or…
- A recipe parameter on Radius environment
- A recipe parameter on Radius environment
- ASPIRERADIUS069
- ASPIRERADIUS070
AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16).
Data as JSON: /api/errors/b5e01421d9b1983e.
Report an issue: GitHub.
Appendix: source
Thrown at src/Aspire.Hosting.Radius/Publishing/RadiusInfrastructureBuilder.cs:4325
}
}
return expressions;
}
/// <summary>
/// Rejects a reference to an endpoint the target resource does not declare, before any code
/// touches <see cref="EndpointReference.EndpointAnnotation"/> (which raises a bare
/// <see cref="InvalidOperationException"/> that would be indistinguishable from a real error).
/// </summary>
private static void ThrowIfEndpointMissing(EndpointReference endpointReference, IResource owner)
{
if (endpointReference.Exists)
{
return;
}
throw new RadiusUnresolvableValueException(
owner,
$"the endpoint '{endpointReference.EndpointName}' is not defined on resource " +
$"'{endpointReference.Resource.Name}'");
}
/// <summary>
/// Splices a composite <see cref="ReferenceExpression"/> into ordered parts by interleaving
/// its literal <see cref="ReferenceExpression.Format"/> chunks with the recursively-resolved
/// parts of each value provider (matching the <c>{0}</c>, <c>{1}</c>, ... placeholders).
/// </summary>
private async Task ResolveReferenceExpressionPartsAsync(ReferenceExpression expression, IResource owner, List<EnvPart> parts, IResource referencedResource, bool allowRecipeSubstitutions = true)
{
// A conditional expression carries no format at all and exposes the *union* of both
// branches' providers, so the splice below would resolve both branches — potentially
// failing the publish on the inactive one — and then append nothing, leaving the variable
// empty. Select the branch first, matching ReferenceExpression.GetValueAsync and
// ExpressionResolver.EvalExpressionAsync.
if (expression.IsConditional)View on GitHub (pinned to 25830f84bd)