From 3735ef928cff171b2d611df0c015f1248e04baed Mon Sep 17 00:00:00 2001 From: Muhammad Azeez Date: Mon, 18 Jan 2021 11:32:31 +0300 Subject: [PATCH] add razor live view --- .../OidcSamples.TaxApp/OidcSamples.TaxApp.csproj | 1 + CSharp/OidcSamples/OidcSamples.TaxApp/Startup.cs | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/CSharp/OidcSamples/OidcSamples.TaxApp/OidcSamples.TaxApp.csproj b/CSharp/OidcSamples/OidcSamples.TaxApp/OidcSamples.TaxApp.csproj index f13cc6a..0c6f7a4 100644 --- a/CSharp/OidcSamples/OidcSamples.TaxApp/OidcSamples.TaxApp.csproj +++ b/CSharp/OidcSamples/OidcSamples.TaxApp/OidcSamples.TaxApp.csproj @@ -9,6 +9,7 @@ + diff --git a/CSharp/OidcSamples/OidcSamples.TaxApp/Startup.cs b/CSharp/OidcSamples/OidcSamples.TaxApp/Startup.cs index 7726133..30d862a 100644 --- a/CSharp/OidcSamples/OidcSamples.TaxApp/Startup.cs +++ b/CSharp/OidcSamples/OidcSamples.TaxApp/Startup.cs @@ -17,6 +17,7 @@ using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading.Tasks; +using Westwind.AspNetCore.LiveReload; namespace OidcSamples.TaxApp { @@ -40,6 +41,13 @@ namespace OidcSamples.TaxApp services.AddRazorPages().AddRazorRuntimeCompilation(); + services.AddLiveReload(config => + { + // optional - use config instead + //config.LiveReloadEnabled = true; + //config.FolderToMonitor = Path.GetFullname(Path.Combine(Env.ContentRootPath,"..")) ; + }); + services.AddControllersWithViews(); services.AddAuthentication(options => @@ -93,6 +101,9 @@ namespace OidcSamples.TaxApp // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { + // IMPORTANT: Before **any other output generating middleware** handlers including error handlers + app.UseLiveReload(); + if (env.IsDevelopment()) { app.UseDeveloperExceptionPage();