diff --git a/Startup.cs b/Startup.cs index 6df9134..bd73746 100644 --- a/Startup.cs +++ b/Startup.cs @@ -36,7 +36,12 @@ namespace pwt_0x01_ng }); services.AddControllersWithViews(); - services.AddRazorPages(); + IMvcBuilder builder = services.AddRazorPages(); +#if DEBUG + if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT").Equals("Development")){ + builder.AddRazorRuntimeCompilation(); + } +#endif var connectionString = Environment.GetEnvironmentVariable("DB_CONNECTION_STRING"); services.AddDbContext(options =>