question

JJTT-0327 avatar image
0 Votes"
JJTT-0327 asked TianyuSun-MSFT commented

The hot reload's function restart from stratch

Goal:
When I make a changes and save it, it should be changed without the applicaiton to be restarted by shuting down and restarting.

Problem:
I have installed VS 2022 community and when I tried using hot reload (icon flame boll), it restart the application.

183370-q1.png

182949-d1.png



Compare to this page https://dotnetcoretutorials.com/2022/01/12/hot-reload-in-c-net-6-visual-studio-2022/ .When you have added a new changes and save it, the applicaiton will display the new data without shutting down and restarting. (the hot reload icon is similiar as ying and yang.)

What part am I missing?


182970-d2.gif


dotnet-csharpvs-general
d1.png (7.2 KiB)
d2.gif (136.5 KiB)
q1.png (9.4 KiB)
· 10
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


It seems to work as expected. Pressing "Hot Reload" (without saving the file) continues execution in the same console.


0 Votes 0 ·

I get the message "Hot Reload can' automatically apply your changes..". Do you get the same message?

0 Votes 0 ·

No.

0 Votes 0 ·

Hi @JJTT-0327 , welcome to Microsoft Q&A forum. It should work, I tested on my side and the Hot Reload feature worked well(tested in VS 2022 Preview, Community and VS 2019 Community). Could you tell me what kind of project(C# Console?...) you are using? Besides, if you test in a newly created project will the same issue appear?

0 Votes 0 ·

C# .net core console.

Do you get the message "Hot Reload can' automatically apply your changes.."

0 Votes 0 ·

Hi @JJTT-0327 , no I didn’t get this message. I tested the codes that shown in the screenshot. Could you let us know what codes you changed? From the screenshot it looks like your changes may not support hot reloading.

0 Votes 0 ·
Show more comments

"the application will display the new data without shutting down and restarting. "

it does this in your gif..

0 Votes 0 ·

It is not my gif picture. It is taken från a another webpage (https://dotnetcoretutorials.com/2022/01/12/hot-reload-in-c-net-6-visual-studio-2022/).

0 Votes 0 ·

0 Answers