Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

206
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda