When using VB.Net (2008) and paused in debugging, Edit-And-Continue is a great time-saver. However if you change any module/class-level information (variable, sub/function signature, etc), you get the error message like this:
"unable to apply this change while debugging"
While I can understand the technical challenge to making this work (and why it would be hard), it leaves me i开发者_如何学运维n a tight spot with just a few options:
1) Restart and recompile and get the program back to the same state
2) Continue debugging without making the change, and risk forgetting 3) Type up a reminder note to make the changeAll of which are annoying.
Now I know that option '4) Just actually make the change' may not be possible. but does anybody know how to enable the following 'technically easy' possibility?
4) Let me change the code, get it flagged with the purple squiggly underline, so I can save it, but just ignore the change until recompile
I have checked the Tools|options|debug|edit and continue, nothing appears to let me do this.
thanks!
You can't do exactly what you want but you could have the solution/project open in another vs instace and change the code in that. You would have to make sure you didn't save it though.
Unfortunately, this is not possible.
It's not as simple as you might think.
At the very least, you will invalidate all of the line numbering (although that happens in normal E&C too).
However, the IDE would need an extra layer of validation to prevent you from doing things like changing method signatures or class interfaces that would make source-level debugging impossible.
In addition, it would be extremely confusing for people who don't understand exactly what's going on.
I don't think that's possible, and when you say that it's easy, I think you forget that Visual Studio then would have to keep track of any changes you've done compared with what it was like at compile time so that it could show you the correct line you're on in the debugger etc, which if you add some lines, delete some other lines and amend some lines could get quite messy to cover all eventualities, and it might be quite confusing too.
精彩评论