![]() |
VOOZH | about |
Requires NuGet 2.12 or higher.
dotnet add package MyCSharp.HttpUserAgentParser --version 3.1.6
NuGet\Install-Package MyCSharp.HttpUserAgentParser -Version 3.1.6
<PackageReference Include="MyCSharp.HttpUserAgentParser" Version="3.1.6" />
<PackageVersion Include="MyCSharp.HttpUserAgentParser" Version="3.1.6" />Directory.Packages.props
<PackageReference Include="MyCSharp.HttpUserAgentParser" />Project file
paket add MyCSharp.HttpUserAgentParser --version 3.1.6
#r "nuget: MyCSharp.HttpUserAgentParser, 3.1.6"
#:package MyCSharp.HttpUserAgentParser@3.1.6
#addin nuget:?package=MyCSharp.HttpUserAgentParser&version=3.1.6Install as a Cake Addin
#tool nuget:?package=MyCSharp.HttpUserAgentParser&version=3.1.6Install as a Cake Tool
Fast HTTP User-Agent parsing for .NET.
Repository: https://github.com/mycsharp/HttpUserAgentParser
dotnet add package MyCSharp.HttpUserAgentParser
string userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36";
HttpUserAgentInformation info = HttpUserAgentParser.Parse(userAgent);
// or: HttpUserAgentInformation.Parse(userAgent)
If you want to inject a parser (e.g., in ASP.NET Core), use IHttpUserAgentParserProvider.
services
.AddHttpUserAgentParser();
services
.AddHttpUserAgentCachedParser();
// or: .AddHttpUserAgentParser<HttpUserAgentParserCachedProvider>();
Telemetry is:
services
.AddHttpUserAgentParser()
.WithTelemetry();
EventSource: MyCSharp.HttpUserAgentParser (constant: HttpUserAgentParserEventSource.EventSourceName)
parse.requests (incrementing)parse.duration (ms, event counter)cache.hit (incrementing)cache.miss (incrementing)cache.size (polling)dotnet-counters monitor --process-id <pid> MyCSharp.HttpUserAgentParser
In addition to EventCounters, this package can emit native System.Diagnostics.Metrics instruments.
Telemetry is:
services
.AddHttpUserAgentParser()
.WithMeterTelemetry();
Meter: MyCSharp.HttpUserAgentParser (constant: HttpUserAgentParserMeters.MeterName)
parse.requests (counter)parse.duration (histogram, ms)cache.hit (counter)cache.miss (counter)cache.size (observable gauge)You can collect these EventCounters via OpenTelemetry metrics and export them (OTLP, Prometheus, Azure Monitor, …).
Packages you typically need:
OpenTelemetryOpenTelemetry.Exporter.OpenTelemetryProtocol (or another exporter)OpenTelemetry.Instrumentation.EventCountersExample (minimal):
using OpenTelemetry.Metrics;
using MyCSharp.HttpUserAgentParser.Telemetry;
builder.Services.AddOpenTelemetry()
.WithMetrics(metrics =>
{
metrics
.AddEventCountersInstrumentation(options =>
{
options.AddEventSources(HttpUserAgentParserEventSource.EventSourceName);
})
.AddOtlpExporter();
});
If you also use the MemoryCache/AspNetCore packages, add their EventSource names too.
If you enabled native meters (see above), collect them via AddMeter(...):
using OpenTelemetry.Metrics;
using MyCSharp.HttpUserAgentParser.Telemetry;
builder.Services.AddOpenTelemetry()
.WithMetrics(metrics =>
{
metrics
.AddMeter(HttpUserAgentParserMeters.MeterName)
.AddOtlpExporter();
});
There are two common approaches:
Collect with OpenTelemetry (see above) and export to Azure Monitor / Application Insights using an Azure Monitor exporter. This keeps your pipeline consistent and avoids custom listeners.
Typical packages (names may differ by version):
OpenTelemetryOpenTelemetry.Instrumentation.EventCountersAzure.Monitor.OpenTelemetry.ExporterIf you prefer a direct listener, you can attach an EventListener and forward values as custom metrics.
High-level idea:
EventCounters payloadNotes:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
Showing the top 5 NuGet packages that depend on MyCSharp.HttpUserAgentParser:
| Package | Downloads |
|---|---|
|
Volo.Abp.AspNetCore
Package Description |
|
|
MyCSharp.HttpUserAgentParser.AspNetCore
HTTP User Agent Parser Extensions for ASP.NET Core |
|
|
ZhileTime.Hope.AspNetCore
Package Description |
|
|
MyCSharp.HttpUserAgentParser.MemoryCache
HTTP User Agent Parser Extensions for IMemoryCache |
|
|
PostalApiClient
Api client for mail delivery platform Postal |
Showing the top 1 popular GitHub repositories that depend on MyCSharp.HttpUserAgentParser:
| Repository | Stars |
|---|---|
|
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.1.6 | 44,505 | 4/1/2026 |
| 3.1.3 | 31,535 | 3/5/2026 |
| 3.0.28 | 722,685 | 8/25/2025 |
| 3.0.27 | 851 | 8/23/2025 |
| 3.0.25 | 836,048 | 4/26/2025 |
| 3.0.23 | 17,996 | 4/12/2025 |
| 3.0.13 | 52,305 | 2/25/2025 |
| 3.0.12 | 709 | 2/25/2025 |
| 3.0.11 | 46,757 | 1/25/2025 |
| 3.0.10 | 24,183 | 1/14/2025 |
| 3.0.9 | 118,647 | 11/12/2024 |