在Visual Studio中调试时可以编辑代码,如eclipse(java)

在Visual Studio中调试时可以编辑代码,如eclipse(java)

问题描述:

在Visual Studio中的断点调试时,是否有编辑代码的选项。当我停止,所有文件似乎被锁定进行编辑。

Is there an option to edit the code when debugging in a breakpoint in Visual Studio. When I stop, all files seems locked for editing.

有没有办法改变这种行为?尝试以下所有建议(包括将其从发行版移动到其调试版本)中,可能在Eclipse中

Is there a way to change this behaviour? It is possible in Eclipse

编辑:现在告诉我,我没有正确的 ms-office 版本,调试无法以调试模式启动。但是,在发布模式下,它正在工作。我试图调试outlook加载项。

after trying all suggested below (including move it to debug from release) now it is telling me I don't have the correct ms-office version and debug cannot start in debug mode. However, in release mode it was working. I am trying to debug an outlook add-in.

是的,它被称为编辑并继续,在工具| 调试下的选项。请注意,它与 IntelliTrace ,所以你必须禁用它,如果你使用它。 (感谢 Anton Semenov 获取该信息。)

Yes, it's called "Edit and Continue", in Tools | Options under Debugging. Note that it's not compatible with IntelliTrace, so you have to disable that if you're using it. (Thank you Anton Semenov for that info.)

编辑:如果您使用的是一个非常旧的版本(原来的VS.Net,而不是VS.Net 2005或更高版本),那么这个(或没有,我不记得了,我只记得被挫败)。但是如果您使用的是VS.Net 2005或更高版本,根据我的经验,默认情况下会启用该功能。当执行暂停时(你说你打破了一个断点,所以...),你可以做出相当多的变化,环境将乐意编译并继续。确保您要调试的所有项目都在解决方案中。

Edit: If you're using a really old version (the original VS.Net, as opposed to VS.Net 2005 or later), it was pretty fiddly about this (or didn't have it, I can't quite recall; I just remember being frustrated). But if you're using VS.Net 2005 or later, in my experience, it's enabled by default and works very well. When execution is paused (and you said you'd hit a breakpoint, so...), you can make quite a variety of changes and the environment will happily compile them and continue. Make sure all of the projects you want to debug are in the solution.