My problem is that when my C# application is running. I cannot successfully run some .exe programs created from an ANSI C source. The event viewer (Administrative events) shows the following error. No error shows in the C# software:
Faulting application name: ediexprt.exe, version: 0.0.0.0, time stamp: 0x62901b9f
Faulting module name: ucrtbase.dll, version: 10.0.19041.789, time stamp: 0x2bd748bf
Exception code: 0xc0000409
Fault offset: 0x0000000000071208
Faulting process id: 0x4644
Faulting application start time: 0x01d875870d36869d
Faulting application path: f:\EDIhz520\ediexprt.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report Id: 0af44e01-ca73-4455-b429-dbd6b60643ce
Faulting package full name:
Faulting package-relative application ID:
I originally wrote an ANSI C commercial application in the late 1990s and it has been running successfully since then with development as required. Of recent times I have been developing an application in C# and have managed to work through the issues that have arisen as I learned about C#. But I cannot solve the problem described here, nor can I find any references to the problem on the web.
My C# application and the ANSI C application are both being developed on the latest Windows version 10, but I have the same problem on Windows 11. I have been developing the C# application in Visual Studio 2019, but today I compiled it under VS 2022 (on the Windows 11 computer) and have the same problem.
I have no reason to believe that c:\windows\system32\ucrtbase.dll is corrupt. If the C# software is not running, then the ANSI C program runs without problem.
The C# application (EDImenu.exe) is currently 711KB in size and growing as I add to the software. The problem first occurred when “using System.Diagnostics” to use the Process Class to start my ANSI C ediexprt.exe program as an external process. The ANSI C .exe is 147KB in size.
When the C# software tried to start the ANSI C .exe, an error showed in the Event Viewer as described earlier. No error showed in the C# software, but I did get a Process result of -1073740791 and that value appears whenever the external Process fails. The ANSI C program did not start. I tried many different ways to get around the problem including starting up a detached child process. The same error occurred. I then tried simply starting the C# software and then in a separate command shell tried to manually run the ANSI program. As before an error appeared in the Event Viewer.
I have found 2 instances in which my ANSI software can be started from a C# program. In the first instance I simply wrote a small C# program that did nothing other than start the ANSI C software via the Process Class. The ANSI C software ran correctly. The second instance was to write a “Hello World” program in ANSI C and when I started this program from my C# program. It ran successfully. I have been unable to find any workaround to successfully run the ANSI C software I need to run. Can you help me?