dotnet / tye

Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
MIT License
5.29k stars 520 forks source link

Object reference not set to an instance of an object on EventCounters for .NET 7 #1547

Open slaterx opened 1 year ago

slaterx commented 1 year ago

Describe the bug

We upgraded our code to .NET 7 and tye now prints these errors on log:

To Reproduce

  1. tye run
  2. See the output on Microservice's log:
[13:42:22 ERR] Error processing counter for Microsoft.AspNetCore.Hosting:EventCounters
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Tye.Hosting.Diagnostics.MetricSink.<>c__DisplayClass2_0.<Attach>b__0(TraceEvent traceEvent) in /_/src/Microsoft.Tye.Hosting.Diagnostics/MetricSink.cs:line 45

Further technical details

Phiph commented 1 year ago

hey @slaterx,

Are you using a dotnet new project? Something like the sample weather controller api app.

.

slaterx commented 1 year ago

No, this is an existing project started on .NET 6 and migrated off to .NET 7

slaterx commented 1 year ago

@Phiph I tested with dotnet new, creating the sample weather controller api, and the result was the same.