I have an application deployed in Azure, since this morning I starting receiving this error:
Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Diagnostics.DiagnosticListener' threw an exception. ---> System.TypeLoadException: Could not load type 'System.Diagnostics.ProductionBreakpointsStub' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at __EnsureBootstrap__System.Diagnostics.DiagnosticSource.dll() at System.Diagnostics.DiagnosticListener..cctor() --- End of inner exception stack trace --- at System.Diagnostics.DiagnosticListener..ctor(String name) at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors) at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at MotionCatalyst.Online.Program.Main(String[] args)
My application is a asp.net core app but target the full framework.
This is the project file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
Locally is working. any help?
I think there might be a bug in current version of Application Insights extension (2.4.7). Does the error go away if you remove the extension from App Service?
The other workaround would be to delete following files manually, but I suppose it also disables the snapshot debugging functionality:
d:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Instrumentation32\ProductionBreakpoints_x86.config
d:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Instrumentation64\ProductionBreakpoints_x64.config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With