Reputation: 2499
So i have just upgraded to Visual Studio 2019 and created new ASP.NET Core project. There i have added some views/css and i hit Debug
.
Problem comes when i change some code in .cshtml
or .css
while debugging
is on. I refresh my page in browser and it doesn't load new content inside that file. It was totally normal thing in 2017.
What to do?
Upvotes: 2
Views: 1828
Reputation: 12705
It's a known issue in Visual Studio 2019 ,try the following steps:
Install the latest version of Visual Studio 2019 16.3.7 .
For change some code in .cshtml
(1) Asp.net core 2.2 , you could load the new content after refreshing the page in browser.
(2) Asp.net core 3.0
services.AddControllersWithViews().AddRazorRuntimeCompilation();
For getting the last version of js and css files , you should add asp-append-version="true"
to your file references like:
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true"/>
Upvotes: 6