Skip to content

Commit fa2f261

Browse files
Merge pull request #222584 from kainawroth/patch-5
Updating tab titles to be less specific about .NET Core versions
2 parents f0caed6 + d602917 commit fa2f261

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

articles/azure-monitor/app/asp-net-core.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ The [Application Insights SDK for ASP.NET Core](https://nuget.org/packages/Micro
4444
* **IDE**: Visual Studio, Visual Studio Code, or command line
4545

4646
> [!NOTE]
47-
> - ASP.NET Core 6.0 requires [Application Insights 2.19.0](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore/2.18.0) or later
48-
> - ASP.NET Core 3.1 requires [Application Insights 2.8.0](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore/2.8.0) or later
47+
> - ASP.NET Core 6.0 requires [Application Insights 2.19.0](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore/2.19.0) or later
4948
5049
## Prerequisites
5150

@@ -86,7 +85,7 @@ For Visual Studio for Mac, use the [manual guidance](#enable-application-insight
8685

8786
2. Add `AddApplicationInsightsTelemetry()` to your `startup.cs` or `program.cs` class (depending on your .NET Core version)
8887

89-
### [ASP.NET Core 6.0](#tab/netcore6)
88+
### [ASP.NET Core 6 and later](#tab/netcorenew)
9089

9190
Add `builder.Services.AddApplicationInsightsTelemetry();` after the `WebApplication.CreateBuilder()` method in your `Program` class, as in this example:
9291

@@ -103,7 +102,7 @@ For Visual Studio for Mac, use the [manual guidance](#enable-application-insight
103102
var app = builder.Build();
104103
```
105104

106-
### [ASP.NET Core 3.1](#tab/netcore3)
105+
### [ASP.NET Core 5 and earlier](#tab/netcoreold)
107106

108107
Add `services.AddApplicationInsightsTelemetry();` to the `ConfigureServices()` method in your `Startup` class, as in this example:
109108

@@ -238,7 +237,7 @@ You can customize the Application Insights SDK for ASP.NET Core to change the de
238237

239238
You can modify a few common settings by passing `ApplicationInsightsServiceOptions` to `AddApplicationInsightsTelemetry`, as in this example:
240239

241-
### [ASP.NET Core 6.0](#tab/netcore6)
240+
### [ASP.NET Core 6 and later](#tab/netcorenew)
242241

243242
```csharp
244243
var builder = WebApplication.CreateBuilder(args);
@@ -255,7 +254,7 @@ builder.Services.AddApplicationInsightsTelemetry(aiOptions);
255254
var app = builder.Build();
256255
```
257256

258-
### [ASP.NET Core 3.1](#tab/netcore3)
257+
### [ASP.NET Core 5 and earlier](#tab/netcoreold)
259258

260259
```csharp
261260
public void ConfigureServices(IServiceCollection services)
@@ -320,7 +319,7 @@ When you want to enrich telemetry with additional information, use [telemetry in
320319

321320
Add any new `TelemetryInitializer` to the `DependencyInjection` container as shown in the following code. The SDK automatically picks up any `TelemetryInitializer` that's added to the `DependencyInjection` container.
322321

323-
### [ASP.NET Core 6.0](#tab/netcore6)
322+
### [ASP.NET Core 6 and later](#tab/netcorenew)
324323

325324
```csharp
326325
var builder = WebApplication.CreateBuilder(args);
@@ -333,7 +332,7 @@ var app = builder.Build();
333332
> [!NOTE]
334333
> `builder.Services.AddSingleton<ITelemetryInitializer, MyCustomTelemetryInitializer>();` works for simple initializers. For others, the following is required: `builder.Services.AddSingleton(new MyCustomTelemetryInitializer() { fieldName = "myfieldName" });`
335334
336-
### [ASP.NET Core 3.1](#tab/netcore3)
335+
### [ASP.NET Core 5 and earlier](#tab/netcoreold)
337336

338337
```csharp
339338
public void ConfigureServices(IServiceCollection services)
@@ -351,7 +350,7 @@ public void ConfigureServices(IServiceCollection services)
351350

352351
By default, telemetry initializers are present. To remove all or specific telemetry initializers, use the following sample code *after* calling `AddApplicationInsightsTelemetry()`.
353352

354-
### [ASP.NET Core 6.0](#tab/netcore6)
353+
### [ASP.NET Core 6 and later](#tab/netcorenew)
355354

356355
```csharp
357356
var builder = WebApplication.CreateBuilder(args);
@@ -373,7 +372,7 @@ builder.Services.RemoveAll(typeof(ITelemetryInitializer));
373372
var app = builder.Build();
374373
```
375374

376-
### [ASP.NET Core 3.1](#tab/netcore3)
375+
### [ASP.NET Core 5 and earlier](#tab/netcoreold)
377376

378377
```csharp
379378
public void ConfigureServices(IServiceCollection services)
@@ -400,7 +399,7 @@ public void ConfigureServices(IServiceCollection services)
400399

401400
You can add custom telemetry processors to `TelemetryConfiguration` by using the extension method `AddApplicationInsightsTelemetryProcessor` on `IServiceCollection`. You use telemetry processors in [advanced filtering scenarios](./api-filtering-sampling.md#itelemetryprocessor-and-itelemetryinitializer). Use the following example.
402401

403-
### [ASP.NET Core 6.0](#tab/netcore6)
402+
### [ASP.NET Core 6 and later](#tab/netcorenew)
404403

405404
```csharp
406405
var builder = WebApplication.CreateBuilder(args);
@@ -415,7 +414,7 @@ builder.Services.AddApplicationInsightsTelemetryProcessor<MySecondCustomTelemetr
415414
var app = builder.Build();
416415
```
417416

418-
### [ASP.NET Core 3.1](#tab/netcore3)
417+
### [ASP.NET Core 5 and earlier](#tab/netcoreold)
419418

420419
```csharp
421420
public void ConfigureServices(IServiceCollection services)
@@ -447,7 +446,7 @@ By default, the following automatic-collection modules are enabled. These module
447446

448447
To configure any default `TelemetryModule`, use the extension method `ConfigureTelemetryModule<T>` on `IServiceCollection`, as shown in the following example.
449448

450-
### [ASP.NET Core 6.0](#tab/netcore6)
449+
### [ASP.NET Core 6 and later](#tab/netcorenew)
451450

452451
```csharp
453452
using Microsoft.ApplicationInsights.DependencyCollector;
@@ -481,7 +480,7 @@ if (performanceCounterService != null)
481480
var app = builder.Build();
482481
```
483482

484-
### [ASP.NET Core 3.1](#tab/netcore3)
483+
### [ASP.NET Core 5 and earlier](#tab/netcoreold)
485484

486485
```csharp
487486
using Microsoft.ApplicationInsights.DependencyCollector;
@@ -524,7 +523,7 @@ In versions 2.12.2 and later, [`ApplicationInsightsServiceOptions`](#using-appli
524523

525524
The default [telemetry channel](./telemetry-channels.md) is `ServerTelemetryChannel`. The following example shows how to override it.
526525

527-
### [ASP.NET Core 6.0](#tab/netcore6)
526+
### [ASP.NET Core 6 and later](#tab/netcorenew)
528527

529528
```csharp
530529
using Microsoft.ApplicationInsights.Channel;
@@ -540,7 +539,7 @@ builder.Services.AddApplicationInsightsTelemetry();
540539
var app = builder.Build();
541540
```
542541

543-
### [ASP.NET Core 3.1](#tab/netcore3)
542+
### [ASP.NET Core 5 and earlier](#tab/netcoreold)
544543

545544
```csharp
546545
using Microsoft.ApplicationInsights.Channel;
@@ -564,7 +563,7 @@ public void ConfigureServices(IServiceCollection services)
564563

565564
If you want to disable telemetry conditionally and dynamically, you can resolve the `TelemetryConfiguration` instance with an ASP.NET Core dependency injection container anywhere in your code and set the `DisableTelemetry` flag on it.
566565

567-
### [ASP.NET Core 6.0](#tab/netcore6)
566+
### [ASP.NET Core 6 and later](#tab/netcorenew)
568567

569568
```csharp
570569
var builder = WebApplication.CreateBuilder(args);
@@ -577,7 +576,7 @@ builder.Services.Configure<TelemetryConfiguration>(x => x.DisableTelemetry = tru
577576
var app = builder.Build();
578577
```
579578

580-
### [ASP.NET Core 3.1](#tab/netcore3)
579+
### [ASP.NET Core 5 and earlier](#tab/netcoreold)
581580

582581
```csharp
583582
public void ConfigureServices(IServiceCollection services)

0 commit comments

Comments
 (0)