Author Topic: using Autodesk.AutoCAD.Interop missing assembly reference  (Read 7789 times)

0 Members and 1 Guest are viewing this topic.

ZNETQ

  • Guest
using Autodesk.AutoCAD.Interop missing assembly reference
« on: August 05, 2014, 04:54:52 AM »
bonjour, I'm having trouble migrating from acad2012 to 2015
I need to use Autodesk.AutoCAD.Interop to make it work

I've added to my project these two references thru Add Reference > COM > Type Librairies :
acax20enu.tlb
axdb20enu.tlb
(example find at http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-BFFF308E-CC10-4C56-A81E-C15FB300EB70)

but using Autodesk.AutoCAD.Interop is still flagged as missing

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: using Autodesk.AutoCAD.Interop missing assembly reference
« Reply #1 on: August 05, 2014, 05:45:05 AM »

Personally, I have unpacked the ObjectARX SDK to

W:\ObjectARX 2015

I reference my development references from there,
ensuring that Copy Local and Embed Interop Types are False in the Properties Pane.

W:\ObjectARX 2015\inc\AcCoreMgd.dll
W:\ObjectARX 2015\inc\AcCui.dll
W:\ObjectARX 2015\inc\AcDbMgd.dll
W:\ObjectARX 2015\inc\acdbmgdbrep.dll
W:\ObjectARX 2015\inc\AcDx.dll
W:\ObjectARX 2015\inc\AcMgd.dll
W:\ObjectARX 2015\inc\AcMr.dll
W:\ObjectARX 2015\inc\AcTcMgd.dll
W:\ObjectARX 2015\inc\AcWindows.dll

W:\ObjectARX 2015\inc-x64\AcAxDb20res.dll
W:\ObjectARX 2015\inc-x64\AdUiPalettes.dll
W:\ObjectARX 2015\inc-x64\Autodesk.AutoCAD.Interop.Common.dll
W:\ObjectARX 2015\inc-x64\Autodesk.AutoCAD.Interop.dll

Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

n.yuan

  • Bull Frog
  • Posts: 313
Re: using Autodesk.AutoCAD.Interop missing assembly reference
« Reply #2 on: August 05, 2014, 09:37:51 AM »
bonjour, I'm having trouble migrating from acad2012 to 2015
I need to use Autodesk.AutoCAD.Interop to make it work

I've added to my project these two references thru Add Reference > COM > Type Librairies :
acax20enu.tlb
axdb20enu.tlb
(example find at http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-BFFF308E-CC10-4C56-A81E-C15FB300EB70)

but using Autodesk.AutoCAD.Interop is still flagged as missing

There are 2 ways to set references to AutoCAD COM APIs: using Autodesk-provided PIA from ObjectARX SDK, or direct set references in VS's "Add References" dialog box's "COM" tab.

Prior to AutoCAD2013, there is no different between the 2 ways, because AutoCAD install the COM interop PIA into GAC. Since Acad2013, AutoCAD stop installing COM Interop PIA into GAC. If you set reference from VS' "Add references" dialog box's COM tab, VS uses COM import tool to generate COM Interop managed assemblies, which has default namespace like "AutoCAD" and "AXDBLib".

On the other hand, if you use COM Interop from the SDK, the namespace is "Autodesk.AutoCAD.Interop/Common".
 
 Either way you do things, there will be no functionality differences except for the namespace name. But using the COM interop provided in SDK might be
preferable because you get more consistent namespace names.

n.yuan

  • Bull Frog
  • Posts: 313
Re: using Autodesk.AutoCAD.Interop missing assembly reference
« Reply #3 on: August 05, 2014, 10:04:17 AM »
Oh, I forgot to mention:

If you set reference through VS's "Add references" dialog box's COM tab (and VS generate the COM interop assemblies: interop.AutoCAd.dll and Interop.AXDBLib.dll), you need to make sure to set "Copy Local" to True (and "Embed Interop Types" to False).

When using SDK's interop assembly, you need to set "Copy to Local" to False, because the 2 COM assemblies (Autodesk.AutoCAD.Interop/.Common.dll) are installed in AutoCAD installation folder (but just not in GAC any more since Acad2013).

ZNETQ

  • Guest
Re: using Autodesk.AutoCAD.Interop missing assembly reference
« Reply #4 on: August 06, 2014, 03:47:59 AM »
Thanks very much to both of you

I don't understand something with the SDK route:
Autodesk.AutoCAD.Interop path is set to C:\ObjectARX 2015\inc-x64\Autodesk.AutoCAD.Interop.dll
I set Copy Local and Embed Interop Types to False

Does it mean that the program requires C:\ObjectARX 2015\inc-x64\Autodesk.AutoCAD.Interop.dll to be present in order to work?
That's not the case on target machines

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: using Autodesk.AutoCAD.Interop missing assembly reference
« Reply #5 on: August 06, 2014, 04:11:58 AM »
< ... >

Does it mean that the program requires C:\ObjectARX 2015\inc-x64\Autodesk.AutoCAD.Interop.dll to be present in order to work?
That's not the case on target machines

The  DLL's and interops will be used from the AutoCAD Application Install .. so you will not need to install the SDK onto the target machines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

ZNETQ

  • Guest
Re: using Autodesk.AutoCAD.Interop missing assembly reference
« Reply #6 on: August 06, 2014, 04:21:28 AM »
That's great!
Thank you!!

MickD

  • Gator
  • Posts: 3498
  • (x-in)->[process]->(y-out)
Re: using Autodesk.AutoCAD.Interop missing assembly reference
« Reply #7 on: August 06, 2014, 04:23:45 AM »
Just to clarify what Kerry and n.yuan just said, the interop assemblies are installed into the GAC (C:\Windows\assembly) folder when you install acad so you don't need to copy them into your output folder.
So you won't find them in the acad install folder.
When you run your app it will look in the same folder as your app first then in the GAC (or maybe the other way, I'm not sure) to find them as this is what the GAC is for.
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

"First, solve the problem. Then, write the code." John Johnson

ZNETQ

  • Guest
Re: using Autodesk.AutoCAD.Interop missing assembly reference
« Reply #8 on: August 07, 2014, 02:03:55 AM »
Thank you!
I'm going to pay attention to this GAC folder!!