❔ 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
Not every change is possible without recompiling afaik
Sometimes good workaround can be moving element around, like
HorizontalOptions
, just to force runtime to repaint itI 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
Can you drop some snippet?
Are you using MAUI, WPF?
Pretty sure im not, im editing the source code of an application i got from GitHub.
I'll send a pic of the error
Attaching a running program to the solution, made //edit, saved it, clicked hot reload and got greeted with that message in red
And if you make breakpoint in that place,
szMode
will get changed value or the previous one?Nothing gets changed, like nothing
as if i never made an edit
is the application in debug config?
Or Release?
release
this might be the case
omg dont tell me switching that to debug will just fix it
probably yes
should i keep it at x86?
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)
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
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
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
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?nah nothing
but after compiling it it works just fine
but compiling takes time and i have to restart the whole process (hl2)
yeah i get it
surely is annoying
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...
this one is cpp related, but the arguments used in cli might also lead you to sth
i'll check that out
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
Alright thank you for your time man
i'll post it here or somewhere if i find a fix
to be clear, this is not a C++ server
I sent this cuz I just wanted to point to CLI parameters
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.
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.
oh i didnt know this
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.