0

我有一个Excel-DNA项目在C#中使用.NET 4.0使用Visual Studio 2010/2015。编辑&继续只有在使用“启动外部程序”,但不附加到过程

如果我启动调试并使用“启动外部程序”功能启动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. 

的是这两种情况的区别? “启动外部程序”与手动连接有什么不同?

回答

1

这是well documented

编辑并继续不在以下调试方案可供选择:

  • 调试,附加到,而不是运行与开始从调试菜单应用的应用。

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

+0

如何连接到正在运行的进程vs“启动”进程有什么不同?如果应用程序支持“编辑”和“连接时继续”,该错误消息听起来像是可能的。如何让应用程序支持它? – robodude666

+0

@ robodude666,“attach to process”用于已在运行的进程,例如调试部署到IIS的ASP.NET应用程序,我们需要使用此功能。但是启动外部程序被用来给你外部程序,它可以帮助你调试你的代码,例如,调试类库项目(我们不能直接调试它),你可以选择启动外部程序并给出一个外部路径程序将调用您的DLL。 –

+0

没错,但是VS启动外部程序后仍然不需要附加进程? – robodude666

相关问题