using System.Runtime.InteropServices; namespace PictureMover { internal static class Program { internal static string[] CommandLineArgs { get; private set; } [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)] static extern bool FreeConsole(); /// /// The main entry point for the application. /// [STAThread] private static void Main(string[] args) { if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") != "Development") { try { FreeConsole(); } catch { //brr } } CommandLineArgs = args; // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); Application.Run(new MainForm()); } } }