Start here. This is the direct spoken answer to practice first.
Why this question matters
A declared dependency can provide configuration without proving that the target is ready or will remain available. Keeping reference, readiness, and runtime failure handling separate prevents fragile startup behavior.
WithReference connects one resource to another in the Aspire application model. Aspire uses that relationship to inject the referenced resource's connection string or endpoint configuration into the consuming process. For service-to-service HTTP calls, the consumer can use a logical name such as https+http://catalog, and .NET service discovery resolves it from the injected endpoints instead of relying on a hard-coded localhost port. A reference describes how the consumer finds the dependency; it does not by itself mean the dependency is healthy. When startup order matters, I add an explicit wait relationship tied to the resource's readiness or health. The application still needs timeouts, cancellation, retries where safe, and degraded behavior for failures that happen after startup.