Visual Studio 2022 vb.net program crashing after 30 hours of running a loop in debug mode

Ceramic Lambda Story 26 Reputation points
2022-10-01T21:19:02.303+00:00

I have vb.net program which runs instructions and interconnects with other equipment via USB, GPIB, and SQL. Since this software is not being deployed it’s only used on a single machine. I always run it in debug mode in Visual Studio. In most cases (99%) it runs fine assuming there are no obvious issues with my code.

Problem: I’m trying to run a specific loop for up to 1 week (24/7) but my program has already crashed for a few reasons (1st reason, the busID of my equipment changed in the middle of the program-cause-firmware issue, 2nd reason, the DLL of one of my controllers did not load correctly (after ~200 cycles) causing my form to crash, and 3rd which I don’t understand:

Managed Debugging Assistant 'FatalExecutionEngineError'
Message=Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0xc53bad41, on thread 0x44f8. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'

My question: Is there some code I can insert which clears any cache or memory that is constantly filling up?

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,828 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,569 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Antonio Guilin 1 Reputation point
    2022-10-03T16:12:38.16+00:00

    @Karen Payne MVP , I value your opinion but your comment does not help me at all. You are correct, I am not a coder I am an electrical engineer trying to automate some factory equipment. We have tried to hire various 'coders' but they simply don't understand the engineering part enough to be effective in writing the code...so here I am.