10

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

Maciej
  • 10,423
  • 17
  • 64
  • 97
  • There is a table [listed here](https://learn.microsoft.com/en-us/visualstudio/debugger/hot-reload?view=vs-2022#supported-net-app-frameworks-and-scenarios) 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](https://learn.microsoft.com/en-us/visualstudio/debugger/hot-reload?view=vs-2022#unsupported-net-scenarios). – Timothy G. Jul 22 '22 at 13:44
  • Thanks but as I said it worked previously with the same solution and code I did change nothing so should meet requirement – Maciej Jul 22 '22 at 20:24
  • 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? – GisMofx Aug 02 '22 at 23:46
  • 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. – Peter Henry Oct 15 '22 at 10:55
  • 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. – aryeh Jun 30 '23 at 01:41

2 Answers2

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

Peter Henry
  • 651
  • 5
  • 17
-2

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.

T.S.
  • 18,195
  • 11
  • 58
  • 78
  • 1
    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? – Jay Imerman Sep 15 '22 at 19:51
  • 1
    @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. – aryeh Jun 30 '23 at 01:38