找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1644|回复: 0

在AUTOCAD 2012下编译和调试Mix-Managed ARX应用程序

[复制链接]

已领礼包: 40个

财富等级: 招财进宝

发表于 2021-2-3 14:35:00 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
Compiling and debugging Mix-Managed ARX application for AutoCAD 2012

问题:

AutoCAD 2012 targets .NET Framework 4.0. This means you have to use VS2010 to debug your .NET application. ObjectARX still requires VS2008 SP1 compiler.

So can you clarify how is it possible to compile and debug a mix-managed application for AutoCAD 2012 ?


解答:

Concerning compiling and running a .Net or mix-managed application for AutoCAD 2012, you can still use VS2008 SP1, but as it doesn't support .Net Framework 4.0, you won't be able to run your application under the debugger.

A mixed-mode arx that can be debugged needs to be compiled with VS2010, platform toolset set to V90 and Framework 3.5 Targeted.

Once this is done, you can run AutoCAD form the debugger and break in managed or unmanaged code.

However, targeting Framework 3.5 in VS2010 is however not so straightforward.

Here are several techniques that expose how to achieve that:


Managed C++ projects will target the Framework 4.0 by default. The reason behind this design is that the VS2010 compiler cannot target Framework 2.0, 3.0 or 3.5. The VS2008 compiler must be used to target 2.0, 3.0 or 3.5. To make the converted C++ application build out of box, Microsoft decided to move the TargetFrameWorkVersion to 4.0 by default for C++ applications.

The Managed C++ applications can be retargeted to other frameworks by one of the following methods:

&#8226;  Edit the vcxproj file and in the first property group ( <PropertyGroup Label="Globals">) add the following:
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>

&#8226;  Open the VS2010 command line, set TargetFrameworkVersion=v3.5, and then start devenv.exe from the commandline. This will target all your C++ applications to v3.5 framework.

&#8226;  Pass /p:TargetFrameworkVersion=v3.5 to MSBuild when building applications: MSBuild my.vcxproj /p:TargetFrameworkVersion=v3.5

Note that VS2008 has to be installed on the machine for the application to target 2.0, 3.0 or 3.5.

For C#/VB.Net applications, conversion does not change the target Framework version if the targeted Framework is installed on the machine.  If the targeted Framework is not installed, you will have the choice of either downloading the required Framework or upgrading the target Framework to 4.0

Please refer to this DevNote for other information about VS2010 and Platform Toolset:

http://adn.autodesk.com/adn/serv ... &linkID=4900509

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-11-21 17:30 , Processed in 0.378563 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表