C
C#14mo 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
Ikarmus14mo 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
alterOP14mo 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
Ikarmus14mo ago
Can you drop some snippet? Are you using MAUI, WPF?
alter
alterOP14mo 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
alterOP14mo ago
No description
alter
alterOP14mo ago
Attaching a running program to the solution, made //edit, saved it, clicked hot reload and got greeted with that message in red
Ikarmus
Ikarmus14mo ago
And if you make breakpoint in that place, szMode will get changed value or the previous one?
alter
alterOP14mo ago
Nothing gets changed, like nothing as if i never made an edit
Ikarmus
Ikarmus14mo ago
is the application in debug config? Or Release?
alter
alterOP14mo ago
release
Ikarmus
Ikarmus14mo ago
this might be the case
alter
alterOP14mo ago
omg dont tell me switching that to debug will just fix it
Ikarmus
Ikarmus14mo ago
probably yes
alter
alterOP14mo ago
should i keep it at x86?
Ikarmus
Ikarmus14mo 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
alterOP14mo 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
Ikarmus14mo 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
alterOP14mo 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
Ikarmus14mo 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
alterOP14mo 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
Ikarmus14mo ago
yeah i get it surely is annoying
Ikarmus
Ikarmus14mo 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
Ikarmus14mo ago
this one is cpp related, but the arguments used in cli might also lead you to sth
alter
alterOP14mo ago
i'll check that out
Ikarmus
Ikarmus14mo 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
alterOP14mo ago
Alright thank you for your time man
Ikarmus
Ikarmus14mo ago
yesmam
alter
alterOP14mo ago
i'll post it here or somewhere if i find a fix
reflectronic
reflectronic14mo ago
to be clear, this is not a C++ server
Ikarmus
Ikarmus14mo ago
I sent this cuz I just wanted to point to CLI parameters
reflectronic
reflectronic14mo 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
reflectronic14mo 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
alterOP14mo ago
oh i didnt know this
Accord
Accord14mo 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.
Want results from more Discord servers?
Add your server