![]() |
VOOZH | about |
dotnet add package Microsoft.Extensions.AmbientMetadata.Application --version 10.7.0
NuGet\Install-Package Microsoft.Extensions.AmbientMetadata.Application -Version 10.7.0
<PackageReference Include="Microsoft.Extensions.AmbientMetadata.Application" Version="10.7.0" />
<PackageVersion Include="Microsoft.Extensions.AmbientMetadata.Application" Version="10.7.0" />Directory.Packages.props
<PackageReference Include="Microsoft.Extensions.AmbientMetadata.Application" />Project file
paket add Microsoft.Extensions.AmbientMetadata.Application --version 10.7.0
#r "nuget: Microsoft.Extensions.AmbientMetadata.Application, 10.7.0"
#:package Microsoft.Extensions.AmbientMetadata.Application@10.7.0
#addin nuget:?package=Microsoft.Extensions.AmbientMetadata.Application&version=10.7.0Install as a Cake Addin
#tool nuget:?package=Microsoft.Extensions.AmbientMetadata.Application&version=10.7.0Install as a Cake Tool
This flows runtime information for application-level ambient metadata such as the version, deployment ring, environment, and name. This information can be useful to enrich telemetry.
From the command-line:
dotnet add package Microsoft.Extensions.AmbientMetadata.Application
Or directly in the C# project file:
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.AmbientMetadata.Application" Version="[CURRENTVERSION]" />
</ItemGroup>
The services can be registered using any of the following methods:
public static IHostBuilder UseApplicationMetadata(this IHostBuilder builder, string sectionName = DefaultSectionName)
public static TBuilder UseApplicationMetadata<TBuilder>(this TBuilder builder, string sectionName = DefaultSectionName) where TBuilder : IHostApplicationBuilder
public static IServiceCollection AddApplicationMetadata(this IServiceCollection services, Action<ApplicationMetadata> configure)
When loading from configuration, the version and deployment ring metadata are read from the ambientmetadata:application section. The environment and application names are read from the IHostEnvironment.
{
"AmbientMetadata" {
"Application" {
"BuildVersion": "1.0-alpha1.2346",
"DeploymentRing": "InnerRing"
}
}
}
The ApplicationMetadata can be injected wherever needed. For example:
public class MyClass
{
public MyClass(IOptions<ApplicationMetadata> options) { Application = options.Value; }
private ApplicationMetadata Application { get; }
public void DoWork()
{
Log.LogEnvironment(Application.Version, Application.DeploymentRing, Application.Environment, Application.Name);
}
}
We welcome feedback and contributions in our GitHub repo.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 2 NuGet packages that depend on Microsoft.Extensions.AmbientMetadata.Application:
| Package | Downloads |
|---|---|
|
Microsoft.Extensions.Telemetry
Provides canonical implementations of telemetry abstractions. |
|
|
AlefCarlos.AspNetCoreDefaults
Package Description |
Showing the top 1 popular GitHub repositories that depend on Microsoft.Extensions.AmbientMetadata.Application:
| Repository | Stars |
|---|---|
| bradygaster/dotnet-cloud-native-build-2023 |
| Version | Downloads | Last Updated |
|---|---|---|
| 10.7.0 | 326,134 | 6/9/2026 |
| 10.6.0 | 2,246,246 | 5/12/2026 |
| 10.5.0 | 3,653,222 | 4/15/2026 |
| 10.4.0 | 3,619,094 | 3/10/2026 |
| 10.3.0 | 3,763,567 | 2/10/2026 |
| 10.2.0 | 3,737,403 | 1/13/2026 |
| 10.1.0 | 4,336,466 | 12/9/2025 |
| 10.0.0 | 6,894,329 | 11/11/2025 |
| 9.10.0 | 5,171,674 | 10/14/2025 |
| 9.9.0 | 4,629,079 | 9/9/2025 |
| 9.8.0 | 2,254,248 | 8/12/2025 |
| 9.7.0 | 3,451,207 | 7/8/2025 |
| 9.6.0 | 2,993,245 | 6/10/2025 |
| 9.5.0 | 2,692,743 | 5/13/2025 |
| 9.4.0 | 3,600,098 | 4/8/2025 |
| 9.3.0 | 2,067,018 | 3/11/2025 |
| 9.2.0 | 3,782,212 | 2/11/2025 |
| 9.1.0 | 2,295,861 | 1/14/2025 |
| 9.0.0 | 6,751,629 | 11/12/2024 |
| 8.10.0 | 17,119,976 | 10/8/2024 |