断点不起作用的原因在于Visual Studio 2010在调试时启动了默认的debugger(v4.0),但是为了让我们的.net应用程序能在AutoCAD Map (或Revit)等上运行,我们需要.net 2.0 framework( 3.5也是运行在CLR 2.0之上的)。
方案1
编辑宿主程序的config 文件(acad.exe.config, revit.exe.config等等),这个文件在AutoCAD的安装目录下。在</configuration>前面加上下面的代码:
<startup>
<supportedRuntime version="v2.0.50727" />
</startup>
方案2
把宿主exe文件作为一个已有的项目加到您的解决方案中,并把debugger设置为v2.0
- 右键单击Solution Explorer,选择Add->Existing Project,浏览到AutoCAD的启动文件Acad.exe

- 右键单击该项目,把它设置为启动项目 Set as StartUp Project

- 设置 Debugger Type 为 Managed v2.0

原文出自 :http://through-the-interface.typepad.com/through_the_interface/2010/04/hitting-breakpoints-in-net-class-libraries-while-debugging-with-visual-studio-2010.html