VB.net Edit-And-Continue: ignore "cannot apply this change while debugging"

When using VB.Net (2008) and pause debugging, Edit-And-Continue is a great time saver. However, if you change the module / class level information (variable, sub / function signature, etc.), you will receive an error like this:

"unable to apply this change while debugging"

      

While I can understand the technical problem for making this work (and why it would be difficult), it leaves me in a bottleneck with several options:

1) Reload and recompile and return the program to the same state
2) Continue debugging without making changes and risking forgetting 3) Enter a reminder to make changes

All this is annoying.

Now I know the option is "4". In fact, making a change "may not be possible." but does anyone know how to enable the following "technically easy" feature?

4) Let me change the code, put it under the purple underscore flag so I can save it, but just ignore this change until re-compilation

I checked Tools | options | debug | edit and continue, nothing lets me do this.

thanks!

+2


a source to share


3 answers


You can't do exactly what you want, but you can have a solution / project open in another vs instace and change the code in that. You would have to be sure not to save it though.



+2


a source


Unfortunately this is not possible.

It is not as easy as you might think.
At the very least, you invalidate all line numbering (although this happens in regular E&C too). However, the IDE will require an extra layer of validation to prevent you from doing things like changing method signatures or class interfaces, which makes it impossible to debug at the source level.



Plus, it would be extremely confusing for people who don't understand what's going on.

0


a source


I don't think this is possible, and when you say it is easy, I think you are forgetting that Visual Studio will then track any changes you made versus what it felt like at compile time, it can show you the correct line you are on in the debugger, etc., which if you add some lines, remove some other lines and change some lines, it can get pretty messy to cover all possible events and it can be pretty confusing.

0


a source







All Articles