.NET

Reply
Member
radek
Posts: 3
Registered: ‎03-15-2012
Message 1 of 6 (1,895 Views)
Accepted Solution

can't load assembly acmgd.dll

1895 Views, 5 Replies
03-15-2012 11:39 AM

Hi

 

I have been trying to interface to AutoCAD from my VS 2010 project without luck. 

My environment is 64bit windows 7 environment. I installed on my computer AutoCad 2012 and ObjectARX 2012. 

 

I created a basic hello world project where I referenced the AcCui.dll AcDbMgd.dll AcMgd.dll but I keep getting errors when running it. 

 

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module.

Additional information: 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.


I have tried it with "Copy Local" false (also with true), I have tried to reference the dlls from the ObjectARX directories as well as the AutoCAD installation folders without luck.

 

Any insight would be apprecaited.

 

Thank you,

Radek


 

 

*Expert Elite*
norman.yuan
Posts: 943
Registered: ‎04-27-2009
Message 2 of 6 (1,885 Views)

Re: can't load assembly acmgd.dll

03-15-2012 12:36 PM in reply to: radek

How did you try "to interface to AutoCAD from VS2010 project"? Is your VS2010 project a windows class library (*.dll) and you loaded into AutoCAD with "NETLOAD" command, or is it an EXE project?

 

If it is latter, then you cannot use the said AutoCAD API assemblies iin an exe project.

Member
radek
Posts: 3
Registered: ‎03-15-2012
Message 3 of 6 (1,870 Views)

Re: can't load assembly acmgd.dll

03-15-2012 01:55 PM in reply to: norman.yuan

Hmmm

 

I'm afraid it is an exe.  We have a very old custom vb6 application that was able to lunch AutoCad with a specified dwg file, then it was able to capture clicks from the autocad gui capturing data from the clicked object, do some computations and create reports. 

 

We managed to compile it so far so it still somewhat runs with 2012, howerver, we need to migrate it to the VS 2010 C# envrionemnt. 

 

What is the most up to date way to achieve this type of functionality?

 

Thank you for your help,

Radek

Member
radek
Posts: 3
Registered: ‎03-15-2012
Message 4 of 6 (1,850 Views)

Re: can't load assembly acmgd.dll

03-16-2012 08:40 AM in reply to: radek

The issue is resolved, thank you for all your input. I was able to interface using COM importing librieries from the common folder.

New Member
erkanhurnali
Posts: 1
Registered: ‎03-19-2012
Message 5 of 6 (1,809 Views)

Re: can't load assembly acmgd.dll

03-19-2012 02:08 PM in reply to: radek

How? I'm sorry I could not understand. Please could you explain more detailed?

*Expert Elite*
norman.yuan
Posts: 943
Registered: ‎04-27-2009
Message 6 of 6 (1,797 Views)

Re: can't load assembly acmgd.dll

03-19-2012 02:29 PM in reply to: erkanhurnali

Obviously, you did not read or understand the posts correctly:

 

If you are to do a stand-alone EXE project (be it Win Form app or console app), you CAN NOT use AutoCAD .NET API assemblies (acdbmgd.dll, acmgd.dll). End of story.

 

The OP's solution is to add reference to COM API (in the "Add references" dialog box, go to "COM" tab and then set reference to AutoCAD Type library and/or Acad ObjectDBX Command type library.

 

In your case (by seeing your attached error picture, you need to remove reference to acdbmsg.dll/acmgd.dll fromo your project.

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community