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.
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.
User contributions licensed under CC BY-SA 3.0