cloudBackupUI/Program.cs
/// <summary>
///  The main entry point for the application.
/// </summary>
The main entry point for the application.
The main entry point for the application .
[STAThread]
        static void Main()
        {
            System.Threading.Thread.CurrentThread.Name = "MainThread";
            var serviceCollection = new ServiceCollection();
            ConfigureServices(serviceCollection);
            var serviceProvider = serviceCollection.BuildServiceProvider();
            var logger = serviceProvider.GetService<Microsoft.Extensions.Logging.ILogger<Program>>();
            var assembly = typeof(Program).Assembly;
            logger.LogInformation("Application with version " + assembly.GetName().Version + " started...");
            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
            logger.LogInformation("Application closing...");
        }
[ STAThread ] static void Main ( ) { System . Threading . Thread . CurrentThread . Name = " " ; var serviceCollection = new ServiceCollection ( ) ; ConfigureServices ( serviceCollection ) ; var serviceProvider = serviceCollection . BuildServiceProvider ( ) ; var logger = serviceProvider . GetService < Microsoft . Extensions . Logging . ILogger < Program > > ( ) ; var assembly = typeof ( Program ) . Assembly ; logger . LogInformation ( " " + assembly . GetName ( ) . Version + " " ) ; Application . SetHighDpiMode ( HighDpiMode . SystemAware ) ; Application . EnableVisualStyles ( ) ; Application . SetCompatibleTextRenderingDefault ( false ) ; Application . Run ( new Form1 ( ) ) ; logger . LogInformation ( " " ) ; }
The main entry point for the application.
The main entry point for the application .
//Setup log with DI //setup UI //Finish log //Use for Microsoft logger.... for serilog, we do it with AppDomain.CurrentDomain.ProcessExit //serviceProvider.Dispose();