// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var con = Configuration.GetSection("PatientApostasis"); var cha = con.GetChildren(); foreach (var configurationSection in cha) { Console.WriteLine(configurationSection.Key + ":" + configurationSection.Value); } services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); SystemStartup.LoadConfig(Configuration); SystemStartup.InitializeIoc(services, Configuration); }
public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true); if (env.IsDevelopment()) { // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709 builder.AddUserSecrets(); } builder.AddEnvironmentVariables(); Configuration = builder.Build(); SystemStartup.Init(); }
private void MainForm_Load(object sender, EventArgs e) { this.Region = new Region(new Rectangle(0, 0, 0, 0)); this.ShowInTaskbar = false; this.Visible = false; //Changes the app path to where i want it to be. if (Application.StartupPath != GlobalVariables.GlobalVariables.AppDirectoryLocation) { SystemStartup.ChangeAppPath(); return; } LoadHooks(); ManageHandlers.AddHandlers(); Thread t = new Thread(ApplicationMethods.StartupChecks); t.Start(); Timers_Management.TimersHandling.InitializeTimers(); }