.NET

.NET

Reply
Active Contributor
btillman
Posts: 48
Registered: ‎07-25-2012
Message 1 of 5 (696 Views)

Build VB.NET program on 2009 then run on 2013

696 Views, 4 Replies
07-25-2012 02:20 PM

I have a computer I'm using for development of a VB.NET project which is heavily interfaced with AutoCAD. This computer is running AutoCAD 2009. This program will very soon need to be run on a computer which is running AutoCAD 2013. Will the be any issues with this or will I need to install my VB 2010 Express on the 2013 machine and build the program again using the COM references to AC 2013 in lieu of 2009?

ADN Support Specialist
wayne.brill
Posts: 198
Registered: ‎08-25-2004
Message 2 of 5 (687 Views)

Re: Build VB.NET program on 2009 then run on 2013

07-25-2012 04:10 PM in reply to: btillman

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, it’s 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

Active Contributor
btillman
Posts: 48
Registered: ‎07-25-2012
Message 3 of 5 (660 Views)

Re: Build VB.NET program on 2009 then run on 2013

07-27-2012 05:51 AM in reply to: wayne.brill

Wayne,

 

Thanks very much for your reply. I'm not sure I fully grasp this. So let me explain what I do understand and let's see if it's what you're suggesting.

 

On the machine at my desk which is running 2009, I build my program and I have added the COM references:

    AutoCAD 2009 Type Library

    AutoCAD/ObjectDBX Common 17.0 Type Library

 

I can build and run this application on this machine just fine. So when I compile it, I should be able to take the .exe file, copy it to the network drives, which I can then access from the other machine running 2013. Then on the computer with 2013 I should be able to successfully run the program?

 

 

Active Contributor
btillman
Posts: 48
Registered: ‎07-25-2012
Message 4 of 5 (657 Views)

Re: Build VB.NET program on 2009 then run on 2013

07-27-2012 06:20 AM in reply to: btillman

I have been moved over to the ACAD 2013 machine for expediency. So on that machine I installed VB 2010 Express and started from the beginning again. So as I start writing, or copying and pasting the same code which worked fine on my other desktop running AutoCAD 2009, I added these references:

 

AutoCAD 2013 Type Library

AutoCAD/ObjectDBX Common 19.0 Type Library

 

The trouble is that now I cannot add the namespace lines:

 

 

Imports Autodesk.AutoCAD.Interop.AcadDocumentClass
Imports Autodesk.AutoCAD.Interop.Common

 

They are not available and of course the code I wrote yesterday on the 2009 system which worked so well is useless without these. I'm still very new to a lot of this so some kindly advice would be appreciated.

 

Active Contributor
btillman
Posts: 48
Registered: ‎07-25-2012
Message 5 of 5 (650 Views)

Re: Build VB.NET program on 2009 then run on 2013

07-27-2012 07:19 AM in reply to: btillman

Okay, I seem to have found it. The syntax for the namespaces has changed substantially. I wonder if the folks who do the development from one release to the next had to do my job. They may stop making so many changes to the syntax. This is like trying to hit a moving target.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.