Sitelet https://github.com/microsoft/ApplicationInsights-aspnetcore/issues/957
Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

2.7.1 and 2.8.0-beta1 throws NullReferenceException when used together with AspNetCore 3.0 preview8 #957

Description

Repro Steps

  1. Create new ASP.NET Core Web Application (Model-View-Controller) using .NET Core 3.0.0-preview8-013656
  2. Add NuGet package: Microsoft.ApplicationInsights.AspNetCore 2.7.1 or 2.8.0-beta1
  3. Add following line to ConfigureServices method in Startup.cs:
    services.AddApplicationInsightsTelemetry();
  4. Start debugging

Actual Behavior

Home page displays error:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.ApplicationInsights.AspNetCore.DiagnosticListeners.Implementation.PropertyFetcher.Fetch(Object obj)
   at Microsoft.ApplicationInsights.AspNetCore.DiagnosticListeners.HostingDiagnosticListener.OnNext(KeyValuePair`2 value)
   at System.Diagnostics.DiagnosticListener.Write(String name, Object value)
   at Microsoft.AspNetCore.Mvc.MvcCoreDiagnosticListenerExtensions.BeforeActionImpl(DiagnosticListener diagnosticListener, ActionDescriptor actionDescriptor, HttpContext httpContext, RouteData routeData)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.SetRoutingAndContinue(HttpContext httpContext)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Expected Behavior

Normal home page

Version Info

SDK Version: 2.7.1 or 2.8.0-beta1
.NET Core Version: 3.0.0-preview8-013656
How Application was onboarded with SDK: Visual Studio Community 2019 Preview Version 16.3.0 Preview 2.0, Installed NuGets: Microsoft.ApplicationInsights.AspNetCore 2.8.0-beta1
OS: Windows 10 Version 1903
Hosting Info: Running From Visual Studio

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions