Click here to Skip to main content
15,885,954 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Why command prompt coming and disappearing on running a windows application in c#?

On running a windows application a command prompt like window comes and vanishes along with the form (start page).

Program.cs code of mine is as below:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace FTS_CB_SIMULATOR
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FTS_CB_SIMULATION());
        }
    }
}
Posted
Updated 1-Feb-16 17:36pm
v2
Comments
Sergey Alexandrovich Kryukov 1-Feb-16 23:22pm    
What without looking at FTS_CB_SIMULATION? Not enough information. I have no idea how your "command prompt" is achieved. The answer to your question is: because you have some bugs in your code.
—SA
PIEBALDconsult 1-Feb-16 23:37pm    
My first guess is that the project type is actually set to Console Application rather than Windows Application. Check that first.
koolprasad2003 1-Feb-16 23:57pm    
Post your 'FTS_CB_SIMULATION' code ? I think you have call cmd.exe using process.start to fire a command on command prompt. Please share your code
ranio 2-Feb-16 0:36am    
Resolved the same. it was developed as Console Application. Changed the Output Type to Windows Application and it worked.
Sinisa Hajnal 2-Feb-16 4:31am    
Please delete this question or post this as an answer. Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900