c# – How to remove Hot Reload Service in .NET


I need to unload the Hot Reload Service from a Blazor app. Simply disabling Hot Reload from the settings does not do that. I am using Visual Studio 2022.

I have tried the recommendations from other posts such as this thread like changing the launch settings and unchecking all variations of “Enable Hot Reload”. However, when I check the memory snapshot, an instance of HotReloadService is still there.

The only way I can make that service not be loaded when viewing the memory snapshot is when going through Debug > Performance Profiler > Start. I need the service unloaded through other methods to verify it being enabled is the cause of some objects being retained in memory than they should.

Edit:

  • Using dotnet watch --no-hot-reload does not enable me to take memory snapshots using Visual Studio’s interface.
  • Using a Release Build still loads the service as with a Debug Build.

Leave a Reply

Your email address will not be published. Required fields are marked *