Hi,
Here is an old article from our knowledge base on this:
>> >>
How to keep .NET COM Interop DLL compatible between a series of AutoCAD versions?
Issue
I have developed several applications that take advantage of the COM API from VB.NET to access named selection sets for AutoCAD 2008. And they worked just fine for my users until I installed AutoCAD 2009 on my development machine. Then when I recompiled those applications that referenced the COM object, the programs are now looking for a 2009 reference, which my clients do not have.
How do I build applications for a 2008 environment after I install 2009? I thought they were binary compatible?
Solution
The COM Interop DLL is registered via the registry using the Public Key Token eed84259d7cbf30b and the specific version of this Interop DLL will relate to the newest version of AutoCAD that you have installed. For AutoCAD 2009 it is 17.2.0.0, for AutoCAD 2008 it is 17.1.51.0.
If you reference the COM Interop DLL's then this Public Key Token is referred to and the specific version is imported, there is nothing you can do to specify the version at this point other than to modify the registry by hand, which we don't advise.
As you have found, compiling against the 17.2.0.0 version gives problems on a raw 2008 system.
Now, it appears that the system only contains the 17.2.0.0 version but actually if you take a look in the Windows\Assembly folder you will see that we install all the versions of the Interop DLL's, its just that the main COM entry in the registry only refers to the newest.
The last thing to know is that those COM Interop DLL's are merely .NET assemblies
To compile your COM Interop DLL against a specific version (preferably the lowest of the series (say 2007)), Add A Reference, go to the specific ObjectARX/inc of the version you want, pick both Interop DLL's and you are then done. In other words, don't include them via the Add Reference->COM tab.
<< <<
Wayne Brill
Developer Technical Services
Autodesk Developer Network