diff --git a/EnotaryoPH/EnotaryoPH.Web/EnotaryoPH.Web.csproj b/EnotaryoPH/EnotaryoPH.Web/EnotaryoPH.Web.csproj index 715c85b..7586d47 100644 --- a/EnotaryoPH/EnotaryoPH.Web/EnotaryoPH.Web.csproj +++ b/EnotaryoPH/EnotaryoPH.Web/EnotaryoPH.Web.csproj @@ -1,13 +1,18 @@ - - net9.0 - enable - enable - + + net9.0 + enable + enable + + + + + + + + + - - - diff --git a/EnotaryoPH/EnotaryoPH.Web/Program.cs b/EnotaryoPH/EnotaryoPH.Web/Program.cs index a678b87..7bb5521 100644 --- a/EnotaryoPH/EnotaryoPH.Web/Program.cs +++ b/EnotaryoPH/EnotaryoPH.Web/Program.cs @@ -16,7 +16,11 @@ namespace EnotaryoPH.Web .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options => options.LoginPath = new Microsoft.AspNetCore.Http.PathString("/Login")); builder.Services.AddAuthorization(options => options.AddPolicy("PrincipalPolicy", policy => policy.RequireRole("Principal"))); - builder.Services.AddRazorPages(options => options.Conventions.AuthorizeFolder("/Principal", "PrincipalPolicy")); + var razorBuilder = builder.Services.AddRazorPages(options => options.Conventions.AuthorizeFolder("/Principal", "PrincipalPolicy")); +#if DEBUG + razorBuilder.AddRazorRuntimeCompilation(); +#endif + builder.Services.AddDbContext(); builder.Services.AddHttpContextAccessor(); builder.Services.AddSession(options => options.IdleTimeout = TimeSpan.FromMinutes(120));