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
Solved! Go to Solution.
Solved by _gile. Go to Solution.
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.
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
Can't find what you're looking for? Ask the community or share your knowledge.