public static ResultAction <object> RegisterServices(string configurationfile, IServiceCollection services, ILogger logger, bool forceregister)
        {
            ResultAction <object> res = new ResultAction <object>();

            if (!_registerservice || forceregister)
            {
                services.AddMvc().AddApplicationPart(typeof(Program).GetTypeInfo().Assembly).AddControllersAsServices();
                services.AddMediatR(typeof(Program).GetTypeInfo().Assembly);
                ResultAction <IncommingTelemetry> resc = ConfigBuilder.BuildConfiguration <IncommingTelemetry>("telemetry", configurationfile, logger);
                res.CopyStatusFrom(resc);
                if (!res.IsOk)
                {
                    return(res);
                }
                Configuration.incommingtelemetry = resc.datas;

                // telemetry providers are ok ?
                if (!Configuration.incommingtelemetry.IsValid(logger))
                {
                    Environment.Exit(-1);
                }
                logger.LogInformation($"{typeof(DependencyInjection).FullName} RegisterService ok");
                _registerservice = true;
            }
            return(res);
        }