Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
How to make .NET 6.0 Hot Reload work on the simplest "Hello, World" console application?

Consider this C# 10 / .NET 6.0 / Visual Studio 2022 "Hello, World" console application:

// See https://aka.ms/new-console-template for more information

foreach (int _ in Enumerable.Range(0, 100))
{
    Console.WriteLine("Hello, World!");
    Task.Delay(1000).Wait();
}

If I run this program with debugging, or without debugging, changing the World to Earth and then saving the file and clicking "Hot Reload" (Apply Code Changes) button does nothing. The program continues to write to console Hello, World!.

I can force the application to change the string without restarting without using Hot Reload, by using Edit and Continue instead, i.e. by making changes while the application is in break mode.

I did enable all the options for Hot Reload:

enter image description here

Why doesn't the Hot Reload work? Am I doing something wrong? This blog post states it should also work for Console apps.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If you change Task.Delay(1000).Wait() to await Task.Delay(1000) then hot reload on save will work. It seems when a thread is blocked, hot reload doesn't want to work.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!