4

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?

1
  • 1
    What Azure service are you used to host the website? Have you tried to redeploy the website? Commented Nov 24, 2017 at 2:17

4 Answers 4

3

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 
Sign up to request clarification or add additional context in comments.

1 Comment

Removing App Insight extension from app service solve the problem. It was .net 4.6.1 then upgraded to 4.7.1 but I got same result.
2

I had the same problem. Solution was to change .NET framework from 461 to 462.

Comments

2

Removing App Insight extension config files solved the problem.

Comments

0

Restarting the Azure App service solved the issue for me. My application was build with .NET Framework 4.6.1 and Azure App service was running on ASP.NETv4.7 32 bit.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.