# RadiusBackingResourceProjectionException

- Kind: `class`
- Package: [Aspire.Hosting.Radius](/reference/api/csharp/aspire.hosting.radius.md)
- Version: `13.6.0-preview.1.26478.8`
- Namespace: `Aspire.Hosting.Radius`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting.Radius/RadiusBackingResourceProjectionException.cs)
- Inherits: `InvalidOperationException`

Thrown when a Radius backing resource -- a cache, database, or queue provisioned by a Radius recipe rather than deployed as a `Radius.Compute/containers` workload -- cannot be projected to its consumers: its address cannot be determined, or the recipe's own connection and credential outputs cannot be described.

## Definition

```csharp
namespace Aspire.Hosting.Radius;

public sealed class RadiusBackingResourceProjectionException
    : System.InvalidOperationException
{
    // ...
}
```

## Remarks

A backing resource's Kubernetes objects and credentials are created by its recipe, so no value derived from the Aspire endpoint model describes it. The Radius publisher projects the address out of the recipe's own outputs instead. Every other route to that address -- including [RadiusEnvironmentResource.GetHostAddressExpression(EndpointReference)](/reference/api/csharp/aspire.hosting.radius/radiusenvironmentresource/methods.md#gethostaddressexpression-endpointreference) and the cross-environment endpoint resolution other compute publishers use -- would have to guess, so it throws this exception rather than emitting an address that silently resolves to nothing. See [https://github.com/microsoft/aspire/issues/18935](https://github.com/microsoft/aspire/issues/18935).

This type is public because it can surface from a Kubernetes, Azure Container Apps, or Azure App Service publish: those publishers resolve a cross-environment reference through the Radius environment that owns the resource. Catching it requires a type an AppHost author can name.

It derives from `InvalidOperationException` to match the package's publish-time failure convention. Note that `AzureAppServiceEnvironmentResource` 's validation pass catches `InvalidOperationException` around its context lookup; that catch does not cover environment-variable resolution, so this exception is not swallowed there.

## Constructors

- [RadiusBackingResourceProjectionException(IResource, string)](/reference/api/csharp/aspire.hosting.radius/radiusbackingresourceprojectionexception/constructors.md#constructor-iresource-string) -- Initializes a new instance of the [RadiusBackingResourceProjectionException](/reference/api/csharp/aspire.hosting.radius/radiusbackingresourceprojectionexception.md) class.
- [RadiusBackingResourceProjectionException(IResource, string, Exception?)](/reference/api/csharp/aspire.hosting.radius/radiusbackingresourceprojectionexception/constructors.md#constructor-iresource-string-exception) -- Initializes a new instance of the [RadiusBackingResourceProjectionException](/reference/api/csharp/aspire.hosting.radius/radiusbackingresourceprojectionexception.md) class with a reference to the inner exception that is the cause of this exception.

## Properties

- [Resource](/reference/api/csharp/aspire.hosting.radius/radiusbackingresourceprojectionexception/properties.md#resource) : `IResource` `get` -- Gets the backing resource that could not be projected.

## Examples

Deploying the consumer and the backing resource to the same Radius environment resolves the address case. An AppHost that publishes several environments can report the offending resource:

```csharp
try
{
    await app.RunAsync();
}
catch (RadiusBackingResourceProjectionException ex)
{
    Console.Error.WriteLine($"'{ex.Resource.Name}' is provisioned by a Radius recipe and cannot " +
                            $"be projected to its consumers: {ex.Message}");
}
```
