This repository has been archived by the owner on Jun 10, 2020. It is now read-only.
ArgumentNullException caused by DefaultApplicationInsightsServiceConfigureOptions #696
Labels
Milestone
I'm updating to .NET Core 2.1 and I'm running into an error that seems new.
I'm using this library in .NET Core services on Service Fabric (not Kestrel ASP.Net Core services) and it looks like a new change has caused some issues because
IHostingEnvironment
has a nullContentRootPath
.This is the callstack I get:
Here's the line of code where this happens: https://github.com/Microsoft/ApplicationInsights-aspnetcore/blame/43a74c64d01b11929da6a96a9e4501dad5620e53/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/DefaultApplicationInsightsServiceConfigureOptions.cs#L31
It looks like the
DefaultApplicationInsightsServiceConfigureOptions
was DI'ed by default now according to this change: https://github.com/Microsoft/ApplicationInsights-aspnetcore/blame/05dbca38b5ebd54df3fdf1968d497d3ed91c6782/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/ApplicationInsightsExtensions.cs#L181Is there any way to work around this? Without creating a fake
IHostingEnvironment
to get this happy?Version Info
SDK Version : 2.3.0
.NET Version : .NET Core 2.1
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) : Service Fabric
OS : Windows Server 2016 R2
Hosting Info (IIS/Azure WebApps/ etc) :
The text was updated successfully, but these errors were encountered: