How to debug my design form project?

K. MOHANA PRIYA 56 Reputation points
2020-08-19T11:13:48.16+00:00

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 Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,868 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
962 questions
{count} vote

Accepted answer
  1. Bonnie DeWitt 811 Reputation points
    2020-08-25T15:10:49.947+00:00

    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 additional answers

Sort by: Most helpful
  1. Castorix31 82,751 Reputation points
    2020-08-19T11:41:04.007+00:00

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

    1 person found this answer helpful.
    0 comments No comments

  2. K. MOHANA PRIYA 56 Reputation points
    2020-08-25T13:10:47.443+00:00

    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?

    0 comments No comments