private void LocalStartService()
        {
            Program.Logger.Log.Info("Start the service");

            AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
            var appprincipal = Thread.CurrentPrincipal as WindowsPrincipal;

            Program.Logger.Log.Info($"Is in administrators: {appprincipal.IsInRole("Administrators")}");
            Program.Logger.Log.Info($"Windows identity: {WindowsIdentity.GetCurrent().Name}"); //Windows identity: NT AUTHORITY\SYSTEM

            LogSystemInfo();
            WriteExecutingAssemblyVersion();

#if !DEBUG
            using (var impersonation = new Impersonation(BuiltinUser.NetworkService))
            {
#endif
            try
            {
                SDKEnvironment.Initialize();    // General initialize. Always required
                SDKEnvironment.RemoveAllServers();
                TryConnectingToMilestoneServer();
            }
            catch (Exception ex)
            {
                Program.Logger.Log.Error(null, ex);
                Program.Logger.Log.Info($"Windows identity: {WindowsIdentity.GetCurrent().Name}");     //Windows identity: NT AUTHORITY\NETWORK SERVICE
            }
#if !DEBUG
        }
#endif
        }
 public XProtectHelper()
 {
     Environment.Initialize();
 }