.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

make one dll run in all autocad versions?

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
swaywood
3720 Views, 6 Replies

make one dll run in all autocad versions?

i want to make a dll that can run in autocad version from 2004 to 2014,how many projects will be compiled?

Or is there any methods to make only one dll and met all the 2007 to 2014 version?

thanks

swaywood

6 REPLIES 6
Message 2 of 7
_gile
in reply to: swaywood

Hi,

 

It seems to me .NET cames in AutoCAD with the 2005 version and got stable and efficient with the AutoCAD 2007 version and the Framework 2 (you can see this table from here).

 

You cannot have a single DLL for A2007 to A2014 because there was a break in binary compatibility for AutoCAD .NET applications with the 2013 version due to the fact acad.exe has been splitted into acad.exe and AcCore.dll (this is the only one real break in AutoCAD .NET compatibility)

You can see this post on Kean's blog.

So, an AutoCAD .NET application needs almost 2 projects (DLLs) to run from A2007 to A 2014 (one from A2007 to A2012 and another one for A 2013 and later).

 

Very few things have been modified in the acad .NET API between A2007 and A2012, but many new features have been added at each new version (samething for the Frameworks)...

So, an AutoCAD .NET application compiled against A2007 SDK and Framework 2 will work until A2012 in most of the cases.

 

Even with the 2013 break, most of codes won't need any modification to work with A2013 and later.

So, most of the time, you can share the same code between several projects in a single solution.

 

In a solution, bulid a project targeting the libraries and the Framework corresponding to the oldest AutoCAD version you want to be compatible.

Try your application with all autoCAD versions from the oldest to 2012, it will probably work.

In the same solution, for A2013 and later,

- create a new project (class library) targeting the Framework 4, add the required references (acmgd.dll, acdbmgd.dll, accoremgd.dll from ObjectARX 2013\inc (prefered) or AutoCAD 2013 installation folder) ;

- Remove the 'Class1' file

- Right clic the 2013 project > Add > Existing element..., browse to the other project, select the .cs or .vb files, choose 'Add as link' in the 'Add' button popup menu.

- Compile

- Test the application

 

Doing this, the code maintenance will be easier: the modification to the code will affect the both projects.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 7
swaywood
in reply to: _gile

Hi,Gile Thanks so much! I found something in a chinse forum. They write a new dll instead of autocad's 3 dlls using a reflect emthod. It's so cool, but the new dll is very difficult to made, the following is the link. http://bbs.mjtd.com/thread-81355-1-1.html
Message 4 of 7
CADbloke
in reply to: swaywood

As Gile has said, you need to build different DLLs to cater different binary compatabilities. I do it by hand-editing the csproj file. For more details see http://www.theswamp.org/index.php?topic=41868.msg497509#msg497509

- - - - - - -
working on all sorts of things including www.tvCAD.tv & www.CADreplace.com
Message 5 of 7
swaywood
in reply to: CADbloke

Hi,CADbloke
thank you for your reply.
my old method is the same with '_gile', one set of code several sets of project file which including each autocad version or .net version and the code is added by link.
I read your link, but can not understand totally. could you upload a simple example zip or rar file including a VS solution with ONE project control autocad 2007 version and autocad 2013 version.
Message 6 of 7
CADbloke
in reply to: swaywood

I will try to make an example if I can find the time.. IF. The critical thing to remember with my method is that there is only one project, it is the different build configurations that will give you the different versions of the DLLs you need.
- - - - - - -
working on all sorts of things including www.tvCAD.tv & www.CADreplace.com
Message 7 of 7
swaywood
in reply to: CADbloke

you are right, i want to learn from you how to use only one project.
i think it will not take long time, but for me and other programmer, it will save more time.
thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost