.NET Runtime version 2.0.50727.5420 – Fatal Execution Engine Error (000007FEF081AF0E) (80131506)

We had a problem on Citrix XenApp Shared Desktops where certain .NET apps were crashing. In our case, it was an in-house app, a vendor app, and a Microsoft Office app.

In the Windows Application Event Log, we were getting several errors:

Log Name: Application
Source: .NET Runtime
Date: 12/5/2013 6:56:31 AM
Event ID: 1023
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: ServerName
Description:
.NET Runtime version 2.0.50727.5420 – Fatal Execution Engine Error (000007FEF081AF0E) (80131506)

Log Name: Application
Source: Application Error
Date: 12/5/2013 6:56:32 AM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: ServerName
Description:
Faulting application name: ApplicationName, version: 1.0.0.0, time stamp: 0x524c8c08
Faulting module name: mscorwks.dll, version: 2.0.50727.5420, time stamp: 0x4ca2b7e1
Exception code: 0xc0000005
Fault offset: 0x00000000001d1908
Faulting process id: 0x%9
Faulting application start time: 0x%10
Faulting application path: %11
Faulting module path: %12
Report Id: %13

Log Name: Application
Source: RISH
Date: 12/5/2013 6:56:32 AM
Event ID: 1307
Task Category: (2)
Level: Error
Keywords: Classic
User: N/A
Computer: ServerName
Description:
Failed to get format message from C:\Windows\System32\wer.dll with Message ID 3e8.

What we determined was that the Citrix Virtual Memory Optimization service was messing with .NET DLLs, so we disabled it. As long as that service isn’t running, we don’t get those errors anymore.

Please note that there may be a scheduled task called “Memory Optimization Schedule” that will need to be disabled as well. This scheduled task re-enables and starts the service at reboot and 3AM.