2
votes

Over the past couple of days I've observed a significant number of 500's being returned from our web service, and digging into the logs, see these two exceptions occuring:

  • System.BadImageFormatException - Bad IL range.
  • System.InvalidProgramException - Common Language Runtime detected an invalid program.

I am unable to repro on a local instance, and can't get any further info from Azure. Rebooting the machine and redeploying the code do not help. The set of NuGet packages we use haven't changed in quite some time.

This is a ASP.Net Core app running on .Net Core 2.2, hosted in an Azure App Service.

Any suggestions welcome.

1
Are you mixing 32 bit and 64 bit dlls? Loading anything over plugins?Icepickle
This error is related to Application Insights. I do not exactly recall what caused the issue but I think it was related to the version being used by the Virtual Machine. I will check back on this and return with a better answer.Hasan Emrah Süngü

1 Answers

2
votes

I had seen the same questions in one of my emails and had to dig up to see what the solution is.

If you have enabled Application Insights through Portal's Extensions tab please turn it off and enable Application Insights through Portal's Application Insights tab. This should solve your problem hopefully. Here is the issue