Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.4K
Visualizações
Unable to Hot Reload on Visual Studio 2022

I moved my web app from Visual Studio 2019 to 2022 (Preview 7) but I am unable to hot-reload even small changes like changing if(a=b) to if(a!=b) and will require stopping the debugger, and I am unsure what is the 'COMPLUS_ForceENC' environment variable, couldn't find anything about it.

When I create a new web app, hot reload works very well on C# and cshtml.

this is the error shown when I change anything to my original app:

Error ENC2004: Changes made in project require restarting the application: Changes are not allowed when the debugger has been attached to an already running process. Consider setting 'COMPLUS_ForceENC' environment variable before launching your process.

over 4 years ago · Santiago Trujillo
6 Respostas
Responde à pergunta

0

It's a common issue for Preview users. Now you can update for the stable release and enjoy the full features including Hot reload.

Please visit https://visualstudio.microsoft.com/ to download the stable VS 2022 editions

over 4 years ago · Santiago Trujillo Relatório

0

VisualStudio 2022 GA version doesn't works for me either :( looks i'm not the only one, i've noticed i've a icon for the hot reload function different from the one shown in the Microsoft promotional videos, mine is a flame, while the working version seems to have two flames that forms a circle :(

i've found this

*In Visual Studio 2022 GA release Hot Reload support for Blazor WebAssembly when using the Visual Studio debugger isn’t enabled yet. You can still get Hot Reload If you start your app through Visual Studio without the debugger, and we are working to resolve this in the next Visual Studio update.

if i start the program without debugger attached I have Hot Reload, or i can run the app with the debugger without the hot reload, which is expected by the article linked above but the Launch Event is quite misleading as they never mention this nor shown which button is pressed during the demos to start blazor webasm with hot reload working... Anyway they doesn't show debugger and hot reload working together for blazor webasm, so it looks like it's all in our minds :( ... we need to wait

over 4 years ago · Santiago Trujillo Relatório

0

In my case I made a stupid mistake of trying to Hot Reload an application run in Release configuration. Make sure it is Debug :)

enter image description here

over 4 years ago · Santiago Trujillo Relatório

0

In my case, it was due to I have disabled Razor Source Generator <UseRazorSourceGenerator>false</UseRazorSourceGenerator> in the .csproj file. Setting it back to true fixed the issue.

over 4 years ago · Santiago Trujillo Relatório

0

Might be a coincidence, but after updating from 17.0.1 to 17.0.2 it started working. It's strange because in the update log there's no mention to such a bug fix. Try updating to the latest version.

UPDATE Seems that I only got this working on my new .NET 6 project. In the old one migrated to .NET 6 this still happens. Maybe in projects that are not fully migrated to .NET 6 and still using the old startup.cs file won't work correctly. In debug mode, the update notification shows up, but content does not change until a browser refresh.If not in debug mode, refreshing the browser does nothing.

UPDATE 2 Found out that in a new .net 6 Asp.net Web page project, the Hot reload works well if I change .razor files, but in .cshtml files I need to refresh the browser to see changes. I have both file types because I'm using razor pages + Blazor in the same project.

If you try to create a .Net 6 Blazor project I'm almost sure Hot Reload will work.

UPDATE 3 I have now opened an Issue in Dotnet Github. You can follow the issue there. github.com/dotnet/aspnetcore/issues/38809

over 4 years ago · Santiago Trujillo Relatório

0

I was blaming VS for un-functional Hot Reload, but in my case it was caused by trying to Debug ( F5 ) and hot reloading at the same time. Hot reload icon enter image description here did not work at all for blazor apps.

The solution was quite simple. The app needs to be started without debugging ( Ctrl+F5 ) enter image description here

After that hot reload works fine.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda