/// <summary>
        /// The main method
        /// </summary>
        /// <param name="args">Command line arguments. These arguments are expected to be created by <see cref="IChildProcessManager.RunChildProcessAsync{TOutput}"/>.</param>
        /// <returns>Exit code</returns>
        public static int Main(string[] args)
        {
            IExtendedTracer tracer = null;

            try
            {
                // Inject dependencies
                container = DependenciesInjector.GetContainer()
                            .InjectAnalysisDependencies(withChildProcessRunner: false)
                            .WithChildProcessRegistrations(args);

                // Trace
                tracer = container.Resolve <IExtendedTracer>();
                tracer.TraceInformation($"Starting Smart Detector runner process, process ID {Process.GetCurrentProcess().Id}");

                // Run the analysis
                IChildProcessManager childProcessManager = container.Resolve <IChildProcessManager>();
                return(childProcessManager.RunAndListenToParentAsync <SmartDetectorExecutionRequest, List <ContractsAlert> >(args, RunSmartDetectorAsync, ConvertExceptionToExitCode).GetAwaiter().GetResult());
            }
            catch (Exception e)
            {
                tracer?.ReportException(e);
                tracer?.TraceError("Unhandled exception in child process: " + e.Message);
                Console.Error.WriteLine(e.ToString());
                return(-1);
            }
        }
        /// <summary>
        /// The main method
        /// </summary>
        /// <param name="args">Command line arguments. These arguments are expected to be created by <see cref="IChildProcessManager.RunChildProcessAsync{TOutput}"/>.</param>
        /// <returns>Exit code</returns>
        public static int Main(string[] args)
        {
            ITracer tracer = null;

            try
            {
                // Inject dependencies
                container = DependenciesInjector.GetContainer()
                            .InjectAnalysisDependencies(withChildProcessRunner: false)
                            .WithChildProcessTracer(args);

                // Trace
                tracer = container.Resolve <ITracer>();
                tracer.TraceInformation($"Starting signal runner process, process ID {Process.GetCurrentProcess().Id}");

                // Run the analysis
                IChildProcessManager childProcessManager = container.Resolve <IChildProcessManager>();
                childProcessManager.RunAndListenToParentAsync <SmartSignalRequest, List <SmartSignalResultItemPresentation> >(args, RunSignalAsync).Wait();

                return(0);
            }
            catch (Exception e)
            {
                tracer?.TraceError("Unhandled exception in child process: " + e.Message);
                Console.Error.WriteLine(e.ToString());
                return(-1);
            }
        }