Example #1
0
        protected override void OnStart(String[] args)
        {
            try
            {
                Console.WriteLine("OnStart");
                base.OnStart(args);
                // get the name of the assembly
                string exeAssembly = Assembly.GetEntryAssembly().FullName;

                // setup - there you put the path to the config file
                AppDomainSetup setup = new AppDomainSetup();
                setup.ApplicationBase   = System.Environment.CurrentDirectory;
                setup.ConfigurationFile = args[0];

                // create the app domain
                appDomain = AppDomain.CreateDomain("Transcoder", null, setup);
                // create proxy used to call the startup method
                Console.WriteLine("Initializing");
                proxy = (FFRest)appDomain.CreateInstanceAndUnwrap(
                    exeAssembly, typeof(FFRest).FullName);
                Console.WriteLine("Initialized");
                // call the startup method - something like alternative main()
                proxy.Begin();
            }
            catch (Exception ex)
            {
                log.Fatal("A fatal startup exception has occured", ex);
            }
        }
Example #2
0
        protected override void OnStart(String[] args)
        {
            try
            {
                Console.WriteLine("OnStart");
                base.OnStart(args);
                // get the name of the assembly
                string exeAssembly = Assembly.GetEntryAssembly().FullName;

                // setup - there you put the path to the config file
                AppDomainSetup setup = new AppDomainSetup();
                setup.ApplicationBase = System.Environment.CurrentDirectory;
                setup.ConfigurationFile = args[0];

                // create the app domain
                appDomain = AppDomain.CreateDomain("Transcoder", null, setup);
                // create proxy used to call the startup method
                Console.WriteLine("Initializing");
                proxy = (FFRest)appDomain.CreateInstanceAndUnwrap(
                       exeAssembly, typeof(FFRest).FullName);
                Console.WriteLine("Initialized");
                // call the startup method - something like alternative main()
                proxy.Begin();
            }
            catch (Exception ex)
            {
                log.Fatal("A fatal startup exception has occured", ex);
            }
        }