Question:
A quick question about C#?
Jyhe
2011-08-22 16:27:34 UTC
I was watching Notch's (Minecraft creator) livestream recently. Now, he uses Java and the "Eclipse" IDE which has a feature called "Hot Code replacement" which makes it so if you are running/debugging your program, you can make changes to the code while its running and the code will be implemented into the program without the need for a rebuild. Sorry I'm not exactly good at explaining so I'll quote the wiki

"Hot code replace (HCR) is a debugging technique whereby the Eclipse Java debugger transmits new class files over the debugging channel to another JVM. In the case of Eclipse development, this also applies to the VM that runs the runtime workbench. The idea is that you can start a debugging session on a given runtime workbench and change a Java file in your development workbench, and the debugger will replace the code in the receiving VM while it is running. No restart is required, hence the reference to "hot"."

So my question is: Is there a feature similar to this for C# / XNA? It would make game development 10x easier if I could make changes to the code while its debugging so I could see the changes immediately.

Thanks :D
(sorry if you don't understand the question, I fail at explaining :P )
Three answers:
Ratchetr
2011-08-22 16:39:04 UTC
Yes, Microsoft calls it Edit and Continue. (Or at least they are similar).



Execution needs to be stopped before you can edit and continue. Usually you just set a breakpoint somewhere, and do you edits once you hit the breakpoint. Or you can use the Break All option in the debug menu.



See link for details:
peteams
2011-08-22 16:37:19 UTC
Visual Studio calls this feature 'edit and continue'. It's been available for C/C++ for ages, but I don't think it was made available for C# until about 2005.



There are a few restrictions, like you cannot change data types or create new methods. You can only change code while you're stopped in the debugger.



The big gotcha is that it only works for 32-bit code. If you have a 64-bit machine you need to ensure you've set the platform target to x86; look in the Project Properties on the Build tab.
Lorie
2016-02-28 00:58:23 UTC
>> To be a C&A reg, you have to be here 'Regularly' XP >> You will be noticed by the other regs for answering various questions/surveys/polls in the C&A section. Maybe asking as well as answering various anime related questions. >> To get a Top Contributor badge you need :- >> Over 11% BA >> To aim to get at least 200-300 points in the first week, the more the better. A Yahoo! Answers week begins on monday and ends on Sunday midnight. Sunday the points for that week reset! So you want to get as many as you can so come Monday you will find you have the Top Contributor badge. >> If you want a Top Contributor badge in a particular subject then that 200-300 points MUST be in the subject of choice only, but you can be a Top Contributor in up to three catagories. Presumably your just interesting in a C&A TC badge? All you need to do is answer questions in C&A if so. >> To make getting the badge faster, you may want to give people helpful answers increasing your points, you get 10 points for every best answer so the more BA's the faster you'll rack up enough points in the week. >> Warning :: Its easy enough to get the badge, but also easy to lose, so don't stop answering questions even after you have it XD Anyway. Anime Q: What was the first anime you ever watched? >> Neon Genesis Evangelion xP >> Hope this helps :D


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...