FULL VIDEO REVIEW:
In this video, we talk about what happened when we ran into an issue with .NET Core MVC Page Not Refreshing After Changes.
Essentially we made a change to the Razor page with the .cshtml extension in .NET Core MVC and found even though we made a small text change to the page when we ran IIS and refreshed the webpage it would NOT show the changes instantly upon refresh, we had to stop the project and then run it again to see the changes. You can see how this would be highly inefficient. We personally tested this in .NET 5.0. Here we found a solution you can see in the video or blog post.
Video Title: .NET
Core MVC Page Not Refreshing After Changes
https://youtu.be/BkRqGuqDuww
How to Fix Steps:
-
Add Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package to the project
-
Add the following in
Startup.cs
:services.AddControllersWithViews().AddRazorRuntimeCompilation();
Reference:
Conclusion
We were using .NET 5.0 at the time of this writing and this fix did work for us and allowed us to be able to update the same something in the .cshtml and then once the website was refreshed we were able to see the changes right away as opposed to having to restart the project every time to see the changes. So the fix worked great.
*SUBSCRIBE LINK:* SUBSCRIBE NOW
PRODUCT DETAILS
- N/A
Suggestions for the Manufacturer
- N/A
OTHER VIDEOS / Blog Post Recommendations
- N/A
IMPORTANT
Thank you for your support please remember to like and subscribe, ring the notification bell and leave a comment!!
*SUBSCRIBE LINK:* SUBSCRIBE NOW