简体   繁体   English

VS2010无法调试,断点永远不会被命中

[英]VS2010 can't debug, breakpoints are never hit

My Excel AddIn was targeted to .NET 35 SP1, I just changed it to target .NET 4. Now I am not able to debug b/c breakpoints never get stopped. 我的Excel AddIn针对的是.NET 35 SP1,我只是将其更改为目标.NET 4.现在我无法调试b / c断点永远不会停止。 I can set breakpoints, but debugger never stops at any breakpoint. 我可以设置断点,但调试器永远不会在任何断点处停止。 I check that all projects are in Debug configuration. 我检查所有项目是否处于Debug配置中。 thanks 谢谢

I assume because it is an Add In, that you are attaching to the process, rather than the run/debug method? 我假设因为它是一个Add In,你附加到进程,而不是运行/调试方法?

If this is true, and you are attaching to the process make sure that you are attaching using Managed (v4.0), instead of Managed (v2.0, v1.1, v1.0). 如果这是真的,并且您要附加到该进程,请确保使用Managed(v4.0)而不是Managed(v2.0,v1.1,v1.0)进行附加。 Debug->Attach to Process->Attach to: Debug-> Attach to Process-> Attach to:

My assumption is that your AddIn has been disabled in the registry or isn't being loaded. 我的假设是您的AddIn已在注册表中禁用或未加载。 Check the Add-Ins window to see your plugins status. 检查“加载项”窗口以查看插件状态。

Make sure that the build configuration is set to Active(Debug) or Debug under the build tab of the properties window. 确保在属性窗口的“构建”选项卡下将构建配置设置为“ Active(Debug)或“ Debug ”。

在此输入图像描述

Go to the screen shown for Debug, click the Advanced button on the lower right of that screen, make sure Debug Info is NOT "none". 转到Debug显示的屏幕,单击该屏幕右下角的Advanced按钮,确保Debug Info不是“none”。 In other words, make sure the PDB is generated. 换句话说,确保生成PDB。

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

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