如何在.NET Framework 4.0平台下调试Add-in程序?

使用VS2010,.NET Framework 4.0平台,无法进入Add-in的调试状态
已邀请:

朱新颖

赞同来自:

【解决办法】:
如果是.NET Framework 3.5平台下可以直接进行调试,如果是.NET Framework 4.0平台则需要进行设置,具体参考AO帮助文档“How to debug add-ins”章节:
Depending on which version of .NET you are targeting, you may have to alter the Desktop application's configuration file to get debugging to work properly. For example, if you've written an add-in for ArcMap that uses .NET 4.0, make sure v4.0 is set as the supported run-time in ArcMap.exe.config which resides beside ArcMap.exe.
[XML]
<?xml version=1.0 encoding=utf-8?>
<configuration>
<startup>
<supportedRuntime version=v4.0.30319></supportedRuntime>
<!--<supportedRuntime version=v2.0.50727></supportedRuntime>-->
</startup>
...
</configuration>
Conversely, if you can't debug your .NET 3.5 (or under) add-in, make sure .NET 2.0 is listed as the supported run-time in your desktop configuration file.
注意:上文中的v4.0.30319是VS的版本号,可能会与示例中有所不同,具体可以打开该VS环境->Help->About Microsoft Visual Stdio界面,查看其VS版本号。
其中ArcMap.exe.config位于Desktop的安装目录下:ArcGIS 10.2.1Desktop10.2bin 中

要回复问题请先登录注册