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

2011 Type Libraries Breaks 2010

20 REPLIES 20
Reply
Message 1 of 21
dhorger
5178 Views, 20 Replies

2011 Type Libraries Breaks 2010

Hi folks,

I recently installed AutoCAD 2011 for testing purposes, and compiled my .dll (with Visual Studio 2005) with 2011 set as the debug external program. However, now my compiled .dll doesn't work with AutoCAD 2010 and I can't seem to set my Type Library and Autodesk.AutoCAD.Interop.Common references back to 2010 versions, since it looks like they were overwritten in the C:\Program Files\Common Files\Autodesk Shared folder. The error message that pops up on 2010 computers is as follows:

Could not load file or assembly 'Autodesk.AutoCAD.Interop, Version=18.1.0.0, Culture=neutral, PublicKeyToken=...' or one of its dependencies. The system cannot find the file specified.

Is there a way to go back and create dll's for 2010 without uninstalling 2011 or using System Restore?
20 REPLIES 20
Message 2 of 21
norman.yuan
in reply to: dhorger

Since Acad2006 (maybe Acad2005, which I never installed), the Acad COM primary interop assembly is installed in GAC, where different version of the same assembly can be side-by-side.

For example, in my current computer, in the GAC, I have Autodesk.AutoCAD.Interop assemblies of 16.2.xxx (2006), 17.0.xxx(2007), 17.1.xxx(2008) and 17.2(2009).

So, when you set reference to this interop assembly, you should choose the versioon corresponding to your targeting Acad version. If you want your app work with multiple version of Acad, you'd better choose the oldest version of Interop assembly.

Acad's COM API is pretty good at backward compatibility. For example, my CAD addin apps uses Acad.Interop developed with Acad2006 (referenced to 16.2.xxx), but the apps work as expected with acad2007/8/9, recomplied or not.
Message 3 of 21
dhorger
in reply to: dhorger

Thanks, Norman. Maybe I'm just an idiot (distinct possibility), but I'm having difficulty with this. When I click on the Add button to add a reference and go to the COM tab, the only option I have for adding Interop is AutoCAD/ObjectDBX 180.0 Type Library, located in C:\Program Files\Common Files\Autodesk Shared\axdb18enu.tlb. Adding that, it indicates that the path is C:\Windows\assembly\GAC_MSIL\Autodesk.AutoCAD.Interop.Common\18.1.0.0__eed84259d7cbf30b\Autodesk.AutoCAD.Interop.Common.dll. If I go to the Browse tab instead of COM when adding, and go to C:\Windows\Assembly I can see I also have a 18.0.0 path available, but I can't select that from that tab.

It seems like it should be easy... any ideas?
Message 4 of 21
chiefbraincloud
in reply to: dhorger

I had a similar issue when I began upgrading my projects from 2009 to 2010, and the solution for my issue was to go to the Project Properties-> Refereneces Tab, select the autocad references you are using, and show the properties window. There is a property there called Specific Version, set it to true.
Dave O.                                                                  Sig-Logos32.png
Message 5 of 21
dhorger
in reply to: dhorger

I can set both acdbmgd and acmgd to Specific Version, but I don't have that option for the AutoCAD 2011 Type Library and AutoCAD/ObjectDBX Common 18.0 Type Library.
Message 6 of 21
dnl999
in reply to: dhorger

What I noticed after installing 2011 version (in my case Civil 3D 2011) the tlb type libraries which traditionally appeared on the list with different version numbers in the past did not show up. I had to search and load them from the files. Also, some methods are not available although the 2011 COM api documentation lists them as available 2011 COM methods. I am still struggling to see what is going and any reply from Autodesk would be very much appreiciated.

Andrew,
Message 7 of 21
dhorger
in reply to: dhorger

That's what I'm seeing, also. Under COM, I've got AutoCAD 2011 Type Library, but no AutoCAD 2010 Type Library, even though I didn't remove 2010 from my system and it's still functional. The dll I create works on my system on both 2010 and 2011 because the 2011 version of Autodesk.AutoCAD.Interop.dll is present and registered, but won't work on systems that don't have 2011 installed.

I'm afraid I might have to uninstall 2011 just so I can modify the dll for 2010 for my users.
Message 8 of 21
norman.yuan
in reply to: dhorger

Yes, when you install latest release of the same version of Acad (in your case, Acad 2010, and then Acad 2011, both are Version 18), even previous release' PIA is still in the GAC, but the Windows registry, which makes assembly in GAC shown in VS' "References" dialog box, is updated to only show latest release of the same Acad Version.

The easiest way to solve this is to download Acad ObjectARX SDK, The SDK has a "Inc" (and/or "Inc-win32", inc-x64") folder, in which all the reference DLLs are there for you, in cluding the COM Interop ones (Autodesk.AutoCAD.Interop.dll and Autodesk.AutoCAD.Interop.Common.dll).

You can browse to this folder from Reference dialog box and set reference to the interop dll. When your app runs, .NET always try to load the Interop assembly from GAC first.

Therefore, even your computer has 2010 and 2011 installed, you can still set interop reference to 2010 in the SDK folder, thus, your users who only has Acad 2010 can use your app without issue.
Message 9 of 21
dhorger
in reply to: dhorger

Thanks for all your help, Norman. I downloaded the SDK for 2010 and added the acax18enu.tlb and axdb18enu.tlb , but they still point to the AutoCAD 2011 dll's. I'm giving up for now and uninstalling 2011 so I can get back to work.

Thank you everyone for your help!
Message 10 of 21
norman.yuan
in reply to: dhorger

I do not understand why it is still pointing to Acad2011, if you set reference to the Acad.Interop.dll in Acad2010 SDK.

I did a quick test:

1. Start a new VS2008 class library project;
2, Open "add refernce..." dialog box;
3. use "Browse" tab to navigate to targeting ObjectARX SDK saved in the HD (See pic 1);
4. Set reference to AutoCAD.Interop.dll in Acad2010 SDK. the property window show correct version of the assembly is references (18.0.0.0); See pic.2.
5. Remove reference to AutoCAD.Interop.dll from 2010. do the same to AutoCAD.Interop.dll from Acad2011. The property window show the refernced assembly is version 18.1.0.0 (Acad2011).

See the picture attached.

Are you sure you downloaded in Acad2010, not Acad2011? When I went to Autodesk's ObjectARX SDK download site for Acad2011, it offers 3 versions of download (Acad2011/2010/2009). But my Acad 2010 SDK was downloaded last year.

Hint: according to the files I downloaded, the size of Autodesk.AutoCAD.Interop.dll is 140KB (2010) and 144KB (2011). Edited by: norman.yuan on May 7, 2010 7:43 PM
Message 11 of 21
dhorger
in reply to: dhorger

Got it! I was trying to load the COM elements instead of the dll's directly. Loading the dll's worked! Thanks, Norman!
Message 12 of 21
Anonymous
in reply to: dhorger

Where did you get the SDK for 2011?

The SDK on the download page is for AutoCAD 2011.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6387769@discussion.autodesk.com...
Thanks for all your help, Norman. I downloaded the SDK for 2010 and added the
acax18enu.tlb and axdb18enu.tlb , but they still point to the AutoCAD 2011
dll's. I'm giving up for now and uninstalling 2011 so I can get back to work.

Thank you everyone for your help!
Message 13 of 21
dhorger
in reply to: dhorger

Here it is: http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=785550

You select which product to download for at the bottom of the page.
Message 14 of 21
Martin60
in reply to: norman.yuan

Thought I would add that I followed these directions with success.Smiley Very Happy

Message 15 of 21

What happens when sheet sets get thrown into the mix? I've got AutoCAD 2010 and 2011 installed on the machine, and i've downloaded both the 2010 and 2011 SDK's. When I add a reference to "acsmcomponents18.tlb" in the 2010 SDK, it automatically adds a reference to Autodesk.AutoCAD.Interop.Common due to dependancies, however for some reason it insists on referencing the 2011 version "C:\Windows\assembly\GAC_MSIL\Autodesk.AutoCAD.Interop.Common\18.1.0.0...".  If i try to remove this reference and instead reference Autodesk.AutoCAD.Interop.Common from the 2010 SDK, I get compiler errors like this:

 

The project currently contains references to more than one version of Autodesk.AutoCAD.Interop.Common, a direct reference to version 18.0.0.0 and an indirect reference (through 'ACSMCOMPONENTS18Lib.IAcSmSheetSet.Sync') to version 18.1.0.0. Change the direct reference to use version 18.1.0.0 (or higher) of Autodesk.AutoCAD.Interop.Common.

 I'm hesitant that if i change the direct reference to the version in the 2011 SDK, the application will no longer run on AutoCAD 2011. Any ideas on how I could get this work on both 2010 and 2011 without compiling different versions (for both 32-bit and 64-bit!). Is this just some problem with the sheet set COM API?

 

Thanks,

 

-Chris

Message 16 of 21

Did you try removing the reference to AXDBLib from your project?

 

I have a project that uses AcSmComponents18 and I was able

to remove the reference to AXDBLib and compile and run it

without errors.



AcadXTabs for AutoCAD
Supporting AutoCAD 2000-2011


Message 17 of 21

I would....unfortunately i'm making use of a method that requires a loaded AcadDatabase(ACSMCOMPONENTS18Lib.AcSmSheetSetClass.Sync(Autodesk.AutoCAD.Interop.Common.AcadDatabase) so even if i eliminated all other other code using ObectDBX i'd still need to keep the reference.

 

-Chris

Message 18 of 21
Jeffrey_H
in reply to: norman.yuan

It is supposed to be fixed with the update 1 for 2011

 

 

You can also find your answers @ TheSwamp
Message 19 of 21

What specifically is supposed to be fixed? I guess I still don't completely understand the problem....

 

Thanks everyone btw.

Message 20 of 21

Quote from ADN

 

Unfortunately, the AutoCAD 2011 installer does not install the AutoCAD 2010 version (18.0.0.0) of the Autodesk.AutoCAD.Interop.dll. This has already been logged and is supposed to be remedied in the oncoming Update 1 for AutoCAD 2011.

 

 

You can also find your answers @ TheSwamp

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