Code2night
  • Home
  • Guest Posts
  • Tutorial
  • Languages
    • Angular
    • C
    • C#
    • HTML/CSS
    • Java
    • JavaScript
    • Node.js
    • Python
    • React
    • SQL Server
    • TypeScript
  • Post Blog
  • Tools
    • JSON Beautifier
    • HTML Beautifier
    • XML Beautifier
    • CSS Beautifier
    • JS Beautifier
    • PDF Editor
  • Register
  • Login
  1. Home
  2. Blogpost

Visual studio not refreshing changes in browser on reload

Date- Jun 09,2021

8916

Net Core Visual Studio

Issue with .Net core 3.1

So, this issue mainly comes while working with .Net core. However solutions can be bit different in earlier versions of .Net core and after version 3.1. So we will see how to fix that for .Net core 3.1. 

First of all, for fixing this issue we have to add a missing NuGet package in our project. For that , navigate to 

Project ->Manage NuGet Packages  

as shown in the image below :-

Now you have to find a package named Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation . You can have a look at the image below.

So, for avoiding compatibility issues we will be using slightly older version for this. As you can see we have used version 3 for this. After selecting that version, click on Install.


Now after your installation is completed . You can move to the last step. You have to add two lines in ConfigureServices Method.You can see in the screenshot below. Add this line to your startup.cs.

IMvcBuilder builder = services.AddRazorPages();
builder.AddRazorRuntimeCompilation();

After adding these lines, now just rebuild your project and run. And this time your changes will be refreshed on browser reload. So this is how we can fix visual studio reload issue in .Net core 3.1.

S
Shubham Batra
Programming author at Code2Night — sharing tutorials on ASP.NET, C#, and more.
View all posts →

Related Articles

Integrate Stripe Payment Gateway In ASP.NET Core 8.0
Nov 23, 2023
Integrate Stripe Payment Gateway In ASP.NET Core 7.0
Jul 22, 2023
Implement Stripe Payment Gateway In ASP.NET Core
Jul 01, 2023
Get Mime Type for any extension in Asp.Net
May 15, 2023

Comments

Tags

Swagger UI
Swashbuckle
SwashbuckleAspNetCore
Rest API
Postman
Api Testing
ITextSharp
Export to Pdf
AspNet Core
AspNet
C#
View to Pdf in Aspnet
Scheduler
Fibonacci series in Java
Display Fibonacci Series
First C# Program
What is C?
C
C Programming
CodeLobster
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1760
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp Join Us On Facebook
Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, India   info@code2night.com

Quick Links
  • Home
  • Blogs
  • Tutorials
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Guest Posts
Dev Tools
  • JSON Beautifier
  • HTML Beautifier
  • XML Beautifier
  • CSS Beautifier
  • JS Beautifier
  • PDF Editor
By Language
  • Angular
  • C
  • C#
  • HTML/CSS
  • Java
  • JavaScript
  • Node.js
  • Python
  • React
  • SQL Server
  • TypeScript
© 2026 Code2Night. All Rights Reserved.
Built with for developers