protected void InitializeStudioDll()
        {
            log.Info("Initializing the studio dll.");

            try
            {
                StudioDllWrapper.Initialize(new StudioDllImports());
                StudioInitializer.Initialize();
                StudioInitializer.InitializeConsumedAssemblies();

                ProjectManager.CreateTaskFactory = CreateTaskFactory;
                MainWindowHelper.HideMainWindow  = HideMainWindow;

                ProjectManager.GoToBreakInvoke            = GoToBreakInvoke;
                ProjectManager.CreateBreakInvoke          = CreateBreakInvoke;
                ProjectManager.CreateVariableChangeInvoke = CreateVariableChangeInvoke;
            }
            catch (System.Exception ex)
            {
                log.Error("Failed initializing the studio dll", ex);
                // Re-throw the exception to display the failure message.
                throw;
            }

            log.Debug("Finished initializing studio dll.");
        }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            using (var serviceScope = app.ApplicationServices.CreateScope())
            {
                using (var context = serviceScope.ServiceProvider.GetRequiredService <StudioDbContext>())
                {
                    StudioInitializer.Initialize(context);
                }
            }

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseCookiePolicy();

            app.UseAuthentication();
            app.UseStatusCodePagesWithRedirects("~/Home/Error/{0}");

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "Administrator",
                    template: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
 public static void InitializeDbForTests(StudioDbContext context)
 {
     StudioInitializer.Initialize(context);
 }