VS 2022: How to get cshtml hot reload to work
Asked Answered
P

1

7

Am I missing something? I am running VS 2022 version 17.0.5. When I run my ASP.Net core MVC project (TargetFramework: net5.0) nothing happens when I change the cshtml for the current page. I've tried setting Hot Reload on File Save (under the Hot Reload button in the VS toolbar). I've tried reloading the page in the web browser. Nada. The page source and the HTML displayed in the F12 debugger remain unchanged even though I've changed the HTML in the view and saved the changes.

I did some Google searching and found a closed/resolved GitHub issue for exactly this problem. I submitted a new issue (https://github.com/dotnet/aspnetcore/issues/39508)

Place answered 14/1, 2022 at 1:53 Comment(0)
P
7

According to this answer to my bug report, Hot Reload requires the underlying project to target net6.0 (.NET 6).

I haven't verified that this solves my problem. VS 2022 is such a buggy mess (editing .cshtml is really painful) that I've gone back to VS 2019, so I don't have a great incentive to go through the pain of upgrading my projects from net5.0 to net6.0.

Place answered 17/1, 2022 at 1:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.