Hot Reload doesnt work in Visual Studio 2022 - C# (No code changes were found)
Asked Answered
E

3

15

It has worked well in past, but since a while Hot Reload doesn't work to me in Visual Studio 2022 - C#

No matter what change I made it says 'No code changes were found' and obviously changes made are not being honoured

enter image description here

Im running app in debug mode, solution has debug config Below my settings.

Any idea how to make this working again? I very miss this feature... :(

enter image description here

Eyeleteer answered 22/7, 2022 at 7:25 Comment(5)
There is a table listed here that describes the application and what version of Visual Studio and .NET is required for Hot Reload to work. Does you application meet the requirements? The page also has some more scenarios and examples as to what can be Hot Reloaded, as well as unsupported scenarios.Mistletoe
Thanks but as I said it worked previously with the same solution and code I did change nothing so should meet requirementEyeleteer
You're not alone. It seemed to stop working for me after updating VS to 17.2.5. 17.2.6 didn't fix it. I might try to go back to 17.2.4. What version of VS are you using?Selfjustifying
Also having this issue with VS 17.2.5, trying to upgrade to VS 17.3.6 now to see if it resolves the issue.Clad
You can use dotnet watch run which does seem to work fine with hot reload even though CTRL F5 doesn't. Right click the project and select Open in terminal that will open the Developer Powershell where you can run the command.Schaerbeek
C
4

This issue seems to have been resolved with 17.3.6 of Visual Studio. I was experiencing the same issue with 17.2.5 where it reported no code changes. Upgrading fixed the issue.

There was evidence of others having the same issue with 17.2.5 in this microsoft thread; https://developercommunity.visualstudio.com/t/vs2022-hot-reload-edits-were-made-which-cannot-be/1703108#T-N10079489

Also reports that it was fixed with 17.3.0 release. https://developercommunity.visualstudio.com/t/vs2022-hot-reload-edits-were-made-which-cannot-be/1703108#T-N10109880

Clad answered 15/10, 2022 at 11:17 Comment(9)
I confirm it started working again after upgradeEyeleteer
With version VS2022 17.3.6 (XAML) hot reload is broken again. No matter if Android emulator, Android physical device or iOS device is used. See also this MS thread developercommunity.visualstudio.com/t/…Probation
I've vs 17.3.6 and when I run MVC application change HTML and refresh the browser the changes did not appear but I've another MVC application it's working correctly why?Dwyer
17.3.3 Blazor project - not workingLat
17.4.3 - hot reload not working (VB.NET project and .net 7 blazor project)Shorthanded
I have Visual Studio 2022 Version 17.5.2 and still not working...Fight
version 17.7.0 is not working now too.Blastoderm
Yeah, 17.6.5 not working so apparently an upgrade won't help... :/ If Microsoft would focus on stability and not a constant barrage of half-baked "features", they would feel more like an actual software development leader. #exMSFT #bringBackQACentrum
It is evidently broken again in 17.10.0 Preview 1 :/Dentation
T
-1

In .csproj I had this tag <UseRazorSourceGenerator> and I changed it to True and now it works. I followed this guide

Tyra answered 15/11, 2023 at 20:1 Comment(0)
V
-3

I am also having this annoying problem. For now I solved it like this, to run the app:

dotnet watch run --no-hot-reload

I am using the command. The --no-hot-reload argument works.

Ventriloquize answered 26/8, 2022 at 8:41 Comment(3)
Could you please provide more info? That answer is way too simple and leaves out crucial details. Where do you run this command, in a DOS window? In the VS command window? I tried both, neither work. What are you running, the project in the solution? Visual Studio?Seaweed
@JayImerman right click project and select Open in terminal that will open the Developer Powershell where you can run the command. For me just running dotnet watch run works fine with hot reload even though CTRL F5 doesn't.Schaerbeek
Does this fix hot reload or just disable it? I think OP was asking for a solution to make hot reload work, not to disable it.Maddox

© 2022 - 2024 — McMap. All rights reserved.