Editing C# while debugging

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 10:50:05

问题


I know I've dealt with this issue before, but the settings to override this always seem to be changing.

I have a C# project in Visual Studio 2008. While I'm debugging, VS won't let me edit my code. I don't want to Edit and Continue - I just want to make changes for my next build. Edit and Continue is disabled. When I try to edit a file while debugging my project, I get a little message that the files are now Read-Only.

Anyone dealt with this recently in VS2K8?


回答1:


Tools + Options, Debugging + Edit and Continue. Turn off the Enable checkbox. You can now edit the source code. You will get a warning when you continue to debug after you've made a change.




回答2:


I am not sure why Edit and Continue won't work for you. If you are debugging and attached to the process you are debugging in, your pages should be locked or the debugger can't show you what is actively running.

Here is a reference to Edit and Continue. http://whyiamright.wordpress.com/2007/12/20/aspnet-edit-and-continue-in-visual-studio-2005/

If you are programming for the next build, it doesn't make sense to me to be trying to debug your current build.




回答3:


The last time I had this problem I fixed it by changing the following settings:
Project properties -> Compile -> Advanced Compile Options -> Set "Generate debug info" to Full and uncheck "Enable optimizations".

Worked for me. Don't know about you, though.




回答4:


I just tried this in VS2k8. All I had to do was enable Edit and Continue in Tools > Options > Debugging menu.

You won't be able to use E&C when you have projects set to release mode




回答5:


Thanks everyone for your input, even the comments that directly contradict each other. I had tried enabling and disabling Edit-and-Continue a handful of times to no effect. However, I just restarted VS and now my enabling/disabling E&C is affecting my ability to edit during debugging just the way I would have expected. I guess it was just a bug in VS...

Thanks again.




回答6:


In VS 2010, go to Debug->Options->tick Enable Address Level Debugging :) reverse for reverse operation :)



来源:https://stackoverflow.com/questions/447706/editing-c-sharp-while-debugging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!