My program starts and stops immediately.
HSDev
-
bountybob -
bountybob -
Hello,
I am practicing coding in C# with Microsoft Visual Studio 2013 for Windows Desktop.
When I run my program, it starts and then immediately stops, leaving me with this message:
Thread 0x2858 has exited with code 259 (0x103).
Thread 0x548 has exited with code 259 (0x103).
Thread 0x3080 has exited with code 259 (0x103).
'ConsoleApplication1.vshost.exe' (CLR v4.0.30319: ConsoleApplication1.vshost.exe): Loaded 'c:\users\simon\documents\visual studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe'. Symbols have been loaded.
Thread 0x2a78 has exited with code 259 (0x103).
Thread 0x2334 has exited with code 259 (0x103).
The program '[11296] ConsoleApplication1.vshost.exe' has exited with code 0 (0x0).
Yet I am sure that I made no mistakes in my code, and Visual Studio does not indicate any.
By the way, my program is a console application.
I am practicing coding in C# with Microsoft Visual Studio 2013 for Windows Desktop.
When I run my program, it starts and then immediately stops, leaving me with this message:
Thread 0x2858 has exited with code 259 (0x103).
Thread 0x548 has exited with code 259 (0x103).
Thread 0x3080 has exited with code 259 (0x103).
'ConsoleApplication1.vshost.exe' (CLR v4.0.30319: ConsoleApplication1.vshost.exe): Loaded 'c:\users\simon\documents\visual studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe'. Symbols have been loaded.
Thread 0x2a78 has exited with code 259 (0x103).
Thread 0x2334 has exited with code 259 (0x103).
The program '[11296] ConsoleApplication1.vshost.exe' has exited with code 0 (0x0).
Yet I am sure that I made no mistakes in my code, and Visual Studio does not indicate any.
By the way, my program is a console application.
2 answers
-
Without seeing the code, it is very likely that you haven't written anything in your code to keep the console from closing. Since the program has been executed and there are no more operations to perform at the end, it closes.
If your problem matches this description, you just need to add one last line of code to wait for an instruction like Console.ReadKey(); -
Good evening
Without seeing your code, how do you expect us to respond?
See how to post code in a readable way here
https://codes-sources.commentcamarche.net/faq/10686-le-nouveau-codes-sources-comment-ca-marche#balises-code
--
When I was little, the Dead Sea was just a little unwell.
George Burns