There are break changes between 1.x and 2.0 for Application Insights Profiler but the migration should be very easy.
- To use .NET Core CLI:
dotnet add package Microsoft.ApplicationInsights.Profiler.AspNetCore --version 2.1.0-*
- To use package manager:
Install-Package Microsoft.ApplicationInsights.Profiler.AspNetCore -Version 1.1.7-*
There are changes in the configurations. Refer to What's new for details. The minimum step is to remove the obsoleted parameter named 'Interval' form the following location:
- appsettings.[Environment].json
- appsettings.json
- Update the method of
AddServiceProfiler
to remove the option of Interval if it is used.
And that's it.
Hosting startup is supported for .NET Core 3.0 in 2.1.0-beta1 or above.
- Stop setting environment variable specific to .NET Core 2.x: ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.ApplicationInsights.Profiler.AspNetCore
- Use the environment variable: ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.ApplicationInsights.Profiler.HostingStartup30
Read this post for more details.