question

KMOHANAPRIYA-9572 avatar image
0 Votes"
KMOHANAPRIYA-9572 asked BonnieDeWitt-QnA commented

How to debug my design form project?

Hi

 when I am start my debugging the cmd open and close immediately without showing the output of my design form.


It show the program has exited with 0 code like this:

         'ConsoleApp1.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'ConsoleApp1.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\Venky\source\repos\ConsoleApp1\bin\Debug\ConsoleApp1.exe'. Symbols loaded.
The program '[13592] ConsoleApp1.exe' has exited with code 0 (0x0).

I don't know what mistake I have made. pls anyone tell me what to do for this.

windows-formsvs-debugging
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Hi KMOHANAPRIYA,
Does the solution provided by Castorix31 solve your problem? If so, please mark it as an answer.
If not, please explain in detail your project and the problems encountered.
Best Regards,
Daniel Zhang

1 Vote 1 ·
BonnieDeWitt-QnA avatar image
0 Votes"
BonnieDeWitt-QnA answered BonnieDeWitt-QnA commented

You are running a Console app, not a WinForm app, so your ConsoleApp project is "Set as Startup Project". So, if you have a WinForm project, the WinForm project should be "Set as Startup Project".

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you, mam. I made a mistake.
Thank you so much!

0 Votes 0 ·

You're welcome! I'm glad I could help. =0)

1 Vote 1 ·
Castorix31 avatar image
1 Vote"
Castorix31 answered Castorix31 edited

If it is a Console application (as you called it ConsoleApp1.exe), add :
Console.Read(); or Console.ReadLine();


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KMOHANAPRIYA-9572 avatar image
0 Votes"
KMOHANAPRIYA-9572 answered KMOHANAPRIYA-9572 rolled back

Sir, I have already added Console.ReadLine();. Eventhough it doesn't show the output properly.
Also I have a doubt. Is there any need to change in the project property regard to debug?

It showing like this:

'ConsoleApp1.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\Venky\source\repos\ConsoleApp1\bin\Debug\ConsoleApp1.exe'. Symbols loaded.
'ConsoleApp1.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll'. Symbols loaded.
'ConsoleApp1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Symbols loaded.
The thread 0x4df4 has exited with code 0 (0x0).
The thread 0x40e0 has exited with code 0 (0x0).
The thread 0x3ff0 has exited with code 0 (0x0).
The thread 0x1ff8 has exited with code 0 (0x0).
The thread 0x1444 has exited with code 0 (0x0).
The program '[18532] ConsoleApp1.exe' has exited with code 0 (0x0).

For your concern that I did a simple queue program and it executed the output correctly but for this form design program it doesn't show the output properly.
Have I need to change any settings before debugging?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.