Beispiel #1
0
        private void TryLoadMigrationService()
        {
            // Host MigrationService service locally
            if (!GlobalConfiguration.UseWindowsService)
            {
                try
                {
                    m_migrationServiceHost = new CustomConfigServiceHost(MigrationService.GetInstance());
                    m_migrationServiceHost.Open();
                }
                catch (AddressAlreadyInUseException)
                {
                    TraceManager.TraceWarning("Migration service has already been hosted - self-hosting is cancelled.");
                }

                try
                {
                    m_runtimeTraceHost = new CustomConfigServiceHost(typeof(RuntimeTrace));
                    m_runtimeTraceHost.Open();
                }
                catch (AddressAlreadyInUseException)
                {
                    TraceManager.TraceWarning("RuntimeTrace service has already been hosted - self-hosting is cancelled.");
                }
            }
        }
Beispiel #2
0
        private static void TryLocalHostMigrationService()
        {
            // Host MigrationService service locally
            if (!s_useWindowsService)
            {
                try
                {
                    s_migrationServiceHost = new CustomConfigServiceHost(MigrationService.GetInstance());
                    s_migrationServiceHost.Open();
                }
                catch (AddressAlreadyInUseException)
                {
                    Trace("Migration service has already been hosted - self-hosting is cancelled.");
                }

                try
                {
                    s_runtimeTraceHost = new CustomConfigServiceHost(typeof(RuntimeTrace));
                    s_runtimeTraceHost.Open();
                }
                catch (AddressAlreadyInUseException)
                {
                    Trace("RuntimeTrace service has already been hosted - self-hosting is cancelled.");
                }
            }
        }
        public TfsIntegrationService()
        {
            ChangeWorkingDirToExeLocation();

            this.ServiceName  = Constants.TfsIntegrationServiceName;
            this.EventLog.Log = Constants.TfsServiceEventLogName;
            // EventLog.Source is the ServiceName of the service by default

            this.CanHandlePowerEvent = true;
            this.CanPauseAndContinue = true;
            this.CanShutdown         = true;
            this.CanStop             = true;

            m_migrationServiceHost = new CustomConfigServiceHost(MigrationService.GetInstance());
            m_runtimeTraceHost     = new CustomConfigServiceHost(typeof(RuntimeTrace));

            m_hostWCFInWindowsService = GlobalConfiguration.UseWindowsService;
        }