.NET

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

can't load assembly acmgd.dll

2091 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


 

 

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.

*Expert Elite*
norman.yuan
Posts: 1,049
Registered: ‎04-27-2009
Message 2 of 6 (2,081 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 (2,066 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 (2,046 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 (2,005 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: 1,049
Registered: ‎04-27-2009
Message 6 of 6 (1,993 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.

 

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!