You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the APM automatic instrumentation is enabled against an ASP.NET (.NET Framework) application that uses resources in satellite assemblies, the app crashes multiple times. Eventually, it will usually start sending trace and metric data. This is reproducible for me locally. It seems the trigger is the load of the satellite assembly containing resources. As soon as code runs which accesses a resource, the crash occurs.
To Reproduce
Create a ASP.NET WebApi project.
Add MyResources.resx and MyResources.en-US.resx files
Add a single string and value
Consumbe the resource in code
publicclassHomeController:Controller{publicActionResultIndex(){CultureInfooriginalCulture=Thread.CurrentThread.CurrentCulture;try{CultureInfonewCulture=newCultureInfo("en-US");Thread.CurrentThread.CurrentCulture=newCulture;Thread.CurrentThread.CurrentUICulture=newCulture;ViewBag.Title=MyResources.Test;}catch(CultureNotFoundExceptione){Console.WriteLine("Unable to instantiate culture {0}",e.InvalidCultureName);}finally{Thread.CurrentThread.CurrentCulture=originalCulture;Thread.CurrentThread.CurrentUICulture=originalCulture;}returnView();}}
Deploy the app to IIS and observe it starting without issue
After recycling the app pool, as soon as the first code accesses a resource (i.e. a request hits the home controller above), the app will often crash at least once. It generally eventually recovers after several crashes.
The crash can be captured using tools such as DebugDiag. When a rule is active against the app pool, one will often observe at least one crash.
@MobaLinux Unfortunately, there's no workaround for the profiler-based instrumentation. The manual NuGet installation is unaffected and is the current workaround. We spent a fair bit of time trying to find a suitable solution but have yet to solve the issue reliably. Another potential alternative is using the OpenTelemetry auto-instrumentation and exporting to the APM server, although I've yet to test if that runs into similar limitations.
APM Agent version
1.27.0
Operating system and version:
Windows 11
.NET Framework/Core name and version: .NET 4.8
Describe the bug
If the APM automatic instrumentation is enabled against an ASP.NET (.NET Framework) application that uses resources in satellite assemblies, the app crashes multiple times. Eventually, it will usually start sending trace and metric data. This is reproducible for me locally. It seems the trigger is the load of the satellite assembly containing resources. As soon as code runs which accesses a resource, the crash occurs.
To Reproduce
MyResources.resx
andMyResources.en-US.resx
filesThe crash can be captured using tools such as DebugDiag. When a rule is active against the app pool, one will often observe at least one crash.
...Second_Chance_Exception_C0000374.dmp
Expected behavior
The application starts without crashing.
Actual behavior
The application often crashes.
Native call stack at the point of the crash:
CLR call stack, which triggers the issue:
The text was updated successfully, but these errors were encountered: