.NET

Reply
Valued Contributor
tonofsteel
Posts: 93
Registered: ‎12-04-2009
Message 1 of 3 (432 Views)

COM and .NET -> Files missing, Casting problems

432 Views, 2 Replies
04-17-2012 04:23 PM

I am trying to work through:

 

http://through-the-interface.typepad.com/through_the_interface/2009/05/interfacing-an-external-com-a...

 

I do the following as mentioned in the above post to try get past the casting problem:

 

One thing to mention - I found that the calling application was not able to to cast the returned System.__COMObject to LoadableComponent.INumberAddition unless I updated the project settings to "Register from COM Interop" (near the bottom of the Build tab).

 

As well when I try to build the following error comes up the first time, but not again until I "clean" the project in VS2010:

 

Error 1 Cannot register assembly "C:\Users\User\documents\visual studio 2010\Projects\SimpleBasicTest\SimpleBasicTest\bin\Release\LoadableComponent.dll". Could not load file or assembly 'Acmgd, Version=18.2.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. LoadableComponent

 

 

When I check the version in the ObjectARX 2012\INC\ folder for acmgd.dll it is18.2.51.0.0

 

Where is this elusive 18.2.0.0 version hiding?  I do not have any references to the managed DLL's in my stand alone project, I only have a reference to the AutoCAD Type Library from the COM tab in the add reference dialog.

 

I am guessing my casting problem is from it not being able to find acmgd and hence not registering the assembly for COM interop? Ok fine but how do I shove Visual Studio's face into this DLL?  I tried adding it to the project, adding to the folders where the build is, adding it as a reference, basically anything I could think of.  And why is it insisting on a version that does not even exist?

Distinguished Mentor
gasty1001
Posts: 581
Registered: ‎04-11-2010
Message 2 of 3 (425 Views)

Re: COM and .NET -> Files missing, Casting problems

04-17-2012 05:34 PM in reply to: tonofsteel

Hi,

 

Did you set the output directory to the one where the acmgd.dll is? It seems that it's a necesary step in order to resolve de dependency on acmgd.cll. This is almost a copy from a comment in the Kean's Blog.

 

Gaston Nunez

Valued Contributor
tonofsteel
Posts: 93
Registered: ‎12-04-2009
Message 3 of 3 (394 Views)

Re: COM and .NET -> Files missing, Casting problems

04-18-2012 08:59 AM in reply to: tonofsteel

When I set the output directory to the AutoCAD folder I get:

 

Error 1 The assembly "C:\Program Files\Autodesk\Acade 2012\LoadableComponent.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'LoadableComponent.Commands, LoadableComponent'. Error: Element not found. LoadableComponent
 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!