.NET Internal Error 80131506

If you see LoginPI.Logon.exe or LoginPI.Engine.exe crashes, check the Windows Application event logs for the specific crash event.

If you see a .NET internal error 80131506, this is an old .NET garbage-collection (GC) bug.  Since GC happens asynchronously, you will find the programs crash inconsistently.

Log Name:      Application
Source: .NET Runtime
Event ID: 1023
Task Category: None
Level: Error
Keywords: Classic
Application: LoginPi.Engine.exe
Framework Version v4.0.30319
Description: The process was terminated due to an internal error in the .NET Runtime at IP ... (...) with exit code 80131506

The underlying bug was fixed in 2018, so this happens when the .NET system on your OS is not completely up to date.  You will see this most often on Windows 10 LTSR or Server 2016 images.

Currently, it appears that KB5038285 is the correct solution for this. However, KB numbers shift over time with Windows versions. We recommend getting the latest Cumulative Update for .NET Framework that is appropriate to the Windows version of your image. We specifically know that this KB can resolve this issue: