The program '[12460] TestProject.exe' has exited with code -1 (0xffffffff)

1

I am writing a c# windows form project and when I stop the process this message is shown in the output terminal:

The program '[12460] TestProject.exe' has exited with code -1 (0xffffffff).

Though the app is running correctly, the -1 exit code seems unfamiliar. Please can anyone explain me what -1 exit code means? Could'nt wrap my head around it.

c#
.net
windows
forms
asked on Stack Overflow Jan 11, 2021 by Coder111

1 Answer

2

That's the expected behavior. If you click the "Stop" button in Visual Studio, that kills the application immediately and reports the return code as -1 (0xffffffff). If you want to terminate your application normally, click the "X" at the top right corner of the window (if it is a windowed application).

You can also use the "Debug->Detach" menu option to detach the debugger from the application without killing it.

answered on Stack Overflow Jan 11, 2021 by PMF

User contributions licensed under CC BY-SA 3.0