Создаём приложение Windows Forms и делаем следующее... В начале как обычно создаём класс NativeMethods.cs namespace Test { using System.Runtime.InteropServices; internal static class NativeMethods { [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool AllocConsole(); [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool FreeConsole(); } } Код namespace Test { using System.Runtime.InteropServices; internal static class NativeMethods { [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool AllocConsole(); [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool FreeConsole(); } } И в главной точке входа Program.cs namespace Test { using System; using System.IO; using System.Reflection; using System.Windows.Forms; public static class Program { // Текущий путь до нашего .exe файла private static readonly string exeName = Path.GetFileName(Assembly.GetExecutingAssembly().Location); [STAThread] public static void Main() { // Если имя файла называется Test.exe if ("Test.exe".Equals(exeName, StringComparison.CurrentCultureIgnoreCase)) { Application.Run(new MyFrm()); // Запускаем форму } else // Если имя файла не Test.exe { if (NativeMethods.AllocConsole()) // Вызываем консоль { Console.Title = "Console Appllication started"; Console.ReadLine(); NativeMethods.FreeConsole(); } } } } } Код namespace Test { using System; using System.IO; using System.Reflection; using System.Windows.Forms; public static class Program { // Текущий путь до нашего .exe файла private static readonly string exeName = Path.GetFileName(Assembly.GetExecutingAssembly().Location); [STAThread] public static void Main() { // Если имя файла называется Test.exe if ("Test.exe".Equals(exeName, StringComparison.CurrentCultureIgnoreCase)) { Application.Run(new MyFrm()); // Запускаем форму } else // Если имя файла не Test.exe { if (NativeMethods.AllocConsole()) // Вызываем консоль { Console.Title = "Console Appllication started"; Console.ReadLine(); NativeMethods.FreeConsole(); } } } } } Если имя файла называется Test.exe то запускается форма, если нет, консоль. Собственно на этом всё!)