繁体   English   中英

“编辑并继续”仅在使用“启动外部程序”时有效,而在“附加到进程”中无效

[英]Edit & Continue only works when using “Start external program” but not Attach to Process

我使用Visual Studio 2010/2015在使用.NET 4.0的C#中有一个Excel-DNA项目。

如果我启动调试并使用“启动外部程序”功能启动EXCEL.exe,则可以暂停调试器,并且“编辑并继续”可以正常运行。

但是,如果尝试附加到正在运行的EXCEL.exe进程,则会收到一条错误消息,指出由于多种原因之一,不支持“编辑并继续”。 选择附加到进程时,我仅选择了“托管(v4.6,v4.5,v4.0)”。

错误消息指出:

Changes are not allowed in the following cases:
- Attached to a process that does not support Edit and Continue on attach.
- The code being debugged was optimized.
- The assembly being debugged is loaded as domain-neutral.
- The assembly being debugged was loaded through reflection.
- Intellitrace events and call information is enabled.
- The .NET Runtime this program is running does not support edit and continue.

这两种情况之间有什么区别? “启动外部程序”与手动附加有什么不同?

这是有据可查的

在以下调试方案中,“编辑并继续”不可用:

  • 使用“附加到”来调试应用程序,而不是通过“调试”菜单中的“启动”来运行应用程序。

通过使用“启动外部程序”选项找到的解决方法是正确的方法。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM