C
C#2y ago
alter

❔ Visual Studio 2022, Hot Reload Not Recognizing changes in code.

An issue with Visual Studio 2022 Hot Reload not recognizing changes in code, i've been using Google for couple of days now but still no good results. I'm trying to edit (edit & continue) without having to compile everything and restart the application.
34 Replies
Ikarmus
Ikarmus2y ago
Not every change is possible without recompiling afaik Sometimes good workaround can be moving element around, like HorizontalOptions, just to force runtime to repaint it
alter
alterOP2y ago
I know for a fact that the changes Im trying to make can be possible with hot reload. They're pretty basic. The hot reload cant recognize changes in code for some reason
Ikarmus
Ikarmus2y ago
Can you drop some snippet? Are you using MAUI, WPF?
alter
alterOP2y ago
Pretty sure im not, im editing the source code of an application i got from GitHub. I'll send a pic of the error
alter
alterOP2y ago
No description
alter
alterOP2y ago
Attaching a running program to the solution, made //edit, saved it, clicked hot reload and got greeted with that message in red
Ikarmus
Ikarmus2y ago
And if you make breakpoint in that place, szMode will get changed value or the previous one?
alter
alterOP2y ago
Nothing gets changed, like nothing as if i never made an edit
Ikarmus
Ikarmus2y ago
is the application in debug config? Or Release?
alter
alterOP2y ago
release
Ikarmus
Ikarmus2y ago
this might be the case
alter
alterOP2y ago
omg dont tell me switching that to debug will just fix it
Ikarmus
Ikarmus2y ago
probably yes
alter
alterOP2y ago
should i keep it at x86?
Ikarmus
Ikarmus2y ago
release optimizes code, so some changes won't be applied (if you ask me - none would be) if 32bit suits you, sure You said you are attaching to already running app - if you are still developing something, don't use release configuration If its possible, run app from VS (or your another fav IDE)
alter
alterOP2y ago
Still the same issue No changes in code I don't think I can do that, im running hl2.exe and attaching it to VS
Ikarmus
Ikarmus2y ago
Then switching profile won't change anything Idk how hl manages mods (because that's what you are doing I guess), it's possible you will have to keep rebuilding everything each time
alter
alterOP2y ago
I don't think its a hl issue because hot reload seems to be working fine for other people Either its my version or some setting ig? But i've tried everything from google
Ikarmus
Ikarmus2y ago
have you tried deleting your mod from hl, cleaning bin and obj files in solution, building everything in debug and the issue is still there? just making sure Are you using some tutorial?
alter
alterOP2y ago
nah nothing but after compiling it it works just fine but compiling takes time and i have to restart the whole process (hl2)
Ikarmus
Ikarmus2y ago
yeah i get it surely is annoying
Ikarmus
Ikarmus2y ago
GitHub
[SDK] how i can debug my mod? · Issue #1649 · ValveSoftware/halflife
first of all, sorry my english sucks. well, as the title says, i need to debug a mod what i'm making. i'm adding npcs to my mod and the last one crashes when they see me. then, i need to se...
Ikarmus
Ikarmus2y ago
this one is cpp related, but the arguments used in cli might also lead you to sth
alter
alterOP2y ago
i'll check that out
Ikarmus
Ikarmus2y ago
I think I can't really help you anymore, don't know anything about modding, try to post here more info about your project config You can also try the worst thing - recreate empty project in another directory, try hot-reloading something simple in there
alter
alterOP2y ago
Alright thank you for your time man
Ikarmus
Ikarmus2y ago
yesmam
alter
alterOP2y ago
i'll post it here or somewhere if i find a fix
reflectronic
reflectronic2y ago
to be clear, this is not a C++ server
Ikarmus
Ikarmus2y ago
I sent this cuz I just wanted to point to CLI parameters
reflectronic
reflectronic2y ago
your code needs to be compiled with special debug info for Hot Reload to work https://learn.microsoft.com/en-us/visualstudio/debugger/edit-and-continue-visual-cpp?view=vs-2022
Edit and Continue (C++) - Visual Studio (Windows)
Edit and Continue is available for C++ projects. Learn what edits are supported, and how to can control whether, and when, your edits are applied.
reflectronic
reflectronic2y ago
oh, uh, right you are attaching to the process afterwards that won’t work https://learn.microsoft.com/en-us/visualstudio/debugger/supported-code-changes-cpp?view=vs-2022
Unsupported scenarios Edit and Continue for C/C++ is unavailable in the following debugging scenarios: … - Debugging an app by using Attach to instead of running the app by choosing Start on the Debug menu.
alter
alterOP2y ago
oh i didnt know this
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?