Search code examples
asp.netrazornginx-reverse-proxyvps

Razor pages hosting on nginx reverse proxy not showing after dotnet publish


I have an Ubuntu VPS running nginx that reverse proxies my Razor pages. So far the site loads at https but when i edit the index.cshtml file, running dotnet build and publish and restarting service and nginx, the new changes still doesnt show in the browser. I tried ctrl+f5 to and clearing caches but no luck. What am i missing? Thank you.

Added this to Program.cs: builder.Services.AddControllersWithViews().AddRazorRuntimeCompilation();

and added package to VPS: dotnet add package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation

Tried to rebuild: dotnet clean, build, publish restarted NewApp.service (sudo systemctl restart NewApp) restarted nginx


Solution

  • I figured out that I needed to delete the NewApp.dll from the publish folder before rebuilding. I'm closing this thread I hope my issue helps other noobs like me.