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

COM and .NET -> Files missing, Casting problems

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

I am trying to work through:




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=, 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.


Where is this elusive 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
Posts: 582
Registered: ‎04-11-2010
Message 2 of 3 (430 Views)

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

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



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
Posts: 93
Registered: ‎12-04-2009
Message 3 of 3 (399 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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.