1
0
Форкнуть 0

Obsolete IWebHostBuilder extension method in favor of extension methods on IServiceCollection (#931)

This commit is contained in:
Cijo Thomas 2019-07-15 17:40:56 -07:00 коммит произвёл GitHub
Родитель 12b485f8fa
Коммит 23959caca0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1,5 +1,8 @@
# Changelog
## Version 2.8.0-beta2
- [Obsolete extension methods on IWebHostBuilder in favor of AddApplicationInsights extension method on IServiceCollection.](https://github.com/microsoft/ApplicationInsights-aspnetcore/issues/919)
## Version 2.8.0-beta1
- [Add EventCounter collection.](https://github.com/microsoft/ApplicationInsights-aspnetcore/issues/913)
- [Performance fixes: One DiagSource Listener; Head Sampling Feature; No Concurrent Dictionary; etc...](https://github.com/microsoft/ApplicationInsights-aspnetcore/pull/907)

Просмотреть файл

@ -4,6 +4,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using System;
/// <summary>
/// Extension methods for <see cref="IWebHostBuilder"/> that allow adding Application Insights services to application.
@ -15,6 +16,7 @@
/// </summary>
/// <param name="webHostBuilder">The <see cref="IWebHostBuilder"/> instance.</param>
/// <returns>The <see cref="IWebHostBuilder"/>.</returns>
[Obsolete("This method is deprecated in favor of AddApplicationInsightsTelemetry() extension method on IServiceCollection.")]
public static IWebHostBuilder UseApplicationInsights(this IWebHostBuilder webHostBuilder)
{
webHostBuilder.ConfigureServices(collection =>
@ -31,6 +33,7 @@
/// <param name="webHostBuilder">The <see cref="IWebHostBuilder"/> instance.</param>
/// <param name="instrumentationKey">Instrumentation key to use for telemetry.</param>
/// <returns>The <see cref="IWebHostBuilder"/>.</returns>
[Obsolete("This method is deprecated in favor of AddApplicationInsightsTelemetry(string instrumentationKey) extension method on IServiceCollection.")]
public static IWebHostBuilder UseApplicationInsights(this IWebHostBuilder webHostBuilder, string instrumentationKey)
{
webHostBuilder.ConfigureServices(collection => collection.AddApplicationInsightsTelemetry(instrumentationKey));