ExternalEndpoint.Aspire.Hosting
1.1.0
dotnet add package ExternalEndpoint.Aspire.Hosting --version 1.1.0
NuGet\Install-Package ExternalEndpoint.Aspire.Hosting -Version 1.1.0
<PackageReference Include="ExternalEndpoint.Aspire.Hosting" Version="1.1.0" />
paket add ExternalEndpoint.Aspire.Hosting --version 1.1.0
#r "nuget: ExternalEndpoint.Aspire.Hosting, 1.1.0"
// Install ExternalEndpoint.Aspire.Hosting as a Cake Addin #addin nuget:?package=ExternalEndpoint.Aspire.Hosting&version=1.1.0 // Install ExternalEndpoint.Aspire.Hosting as a Cake Tool #tool nuget:?package=ExternalEndpoint.Aspire.Hosting&version=1.1.0
Aspire.Hosting.ExternalEndpoint
Adds the possibility to add external endpoints as resources which can be easily referenced.
Overview
An external endpoint is just a URL which is reachable from wherever you are running your application. This can be a URL to a REST API, a website, a file, etc. The idea is to have a single place where you can define these URLs and then reference them in your code. This way, if the URL changes, you only have to update it in one place.
Usage
The external endpoint takes part in service discovery, so any HttpClient
can simply reference the external endpoint by name just as if you would reference another project.
Alternatively, you can use the ServiceEndpointResolver
from Microsoft.Extensions.ServiceDiscovery
to get the URL in your MyApplication
if you do not want to use HttpClient
.
var externalApi = builder.AddExternalEndpoint("ExternalApi", "https://api.example.com");
var myProject = builder.addProject<MyApplication>("MyApplication")
.WithReference(externalApi);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Aspire.Hosting (>= 8.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.