.NET

Reply
Active Contributor
yuh0317
Posts: 47
Registered: ‎12-03-2009
Message 1 of 18 (3,413 Views)
Accepted Solution

Could not load file or assembly 'accoremgd.dll' or one of its dependencies.

3413 Views, 17 Replies
09-11-2012 07:42 PM

Hi All,

 

I want to create a silent acad process in background and do some works, it works well in AutoCAD 2012. But when I upgrade to AutoCAD 2013, it cannot works. I already had referenced accoremgd.dll. It compiles well, I get the errors "Could not load file or assembly 'accoremgd.dll' or one of its dependencies . The specified module could not be found." when I run my program. Who can tell me what dlls i lose to referenced.

 

Thanks,

Yu

With code like this:

 

Autodesk.AutoCAD.DatabaseServices.Database db = new Autodesk.AutoCAD.DatabaseServices.Database(false, true);

 

It is absolutely impossible to use it in a standalone EXE (as the other reply poited out) since the very begining of AutoCAD .NET API (Acad2005). Yet, you claimed that your code worked with Acad 2012? What was your magic then?

 

Anyway, since you use Acad2013, and want to run "silent" instance of AutoCAD, how about Acad2013 Core Console, a non-graphical AutoCAD instance. See this post from Kean:

 

http://through-the-interface.typepad.com/through_the_interface/2012/02/the-autocad-2013-core-console.html

 

The reason why AutoCAD's managed API cannot be used from another process is because it is dependent on AutoCAD itself, and on AutoCAD DLLs that cannot be loaded into another process. For example, some managed APIs call code in acad.exe, which you can't load into your application.  

 

Some of AutoCAD's components (the parts that allow access to Databases and object in them) can be loaded into another process with a RealDWG license.

 

 

Active Contributor
yuh0317
Posts: 47
Registered: ‎12-03-2009
Message 2 of 18 (3,411 Views)

Re: Could not load file or assembly 'accoremgd.dll' or one of its dependencies.

09-11-2012 07:46 PM in reply to: yuh0317

The following dlls had been referenced.

 

accoremgd

acdbmgd

acmgd

Autodesk.AutoCAD.Interop

Autodesk.AutoCAD.Interop.Common

 

 

Thanks,

Yu

 

 

Valued Mentor
gasty1001
Posts: 480
Registered: ‎04-11-2010
Message 3 of 18 (3,401 Views)

Re: Could not load file or assembly 'accoremgd.dll' or one of its dependencies.

09-11-2012 09:01 PM in reply to: yuh0317

Hi,

 

Is Copy Local set to false?

 

Gaston Nunez

Active Contributor
yuh0317
Posts: 47
Registered: ‎12-03-2009
Message 4 of 18 (3,388 Views)

Re: Could not load file or assembly 'accoremgd.dll' or one of its dependencies.

09-12-2012 12:48 AM in reply to: yuh0317

No matter the value is false or true. The issue is still reproducible. 

 

Yu

Active Contributor
yuh0317
Posts: 47
Registered: ‎12-03-2009
Message 5 of 18 (3,387 Views)

Re: Could not load file or assembly 'accoremgd.dll' or one of its dependencies.

09-12-2012 01:23 AM in reply to: yuh0317

Autodesk.AutoCAD.DatabaseServices.Database db = new Autodesk.AutoCAD.DatabaseServices.Database(false, true);

 

I only create a database object, there is a exception message "Could not load file or assembly 'accoremgd, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."

 

AutoCAD 2013 32-bit.

 

I have attached sample codes.

Active Contributor
yuh0317
Posts: 47
Registered: ‎12-03-2009
Message 6 of 18 (3,384 Views)

Re: Could not load file or assembly 'accoremgd.dll' or one of its dependencies.

09-12-2012 01:24 AM in reply to: yuh0317

I add the following references

 

accoremgd

acdbmgd

acmgd

Autodesk.AutoCAD.Interop

Autodesk.AutoCAD.Interop.Common

Moderator
Alexander.Rivilis
Posts: 1,417
Registered: ‎04-09-2008
Message 7 of 18 (3,381 Views)

Re: Could not load file or assembly 'accoremgd.dll' or one of its dependencies.

09-12-2012 01:55 AM in reply to: yuh0317

Are you trying to create standalone exe-file?


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Active Contributor
yuh0317
Posts: 47
Registered: ‎12-03-2009
Message 8 of 18 (3,369 Views)

Re: Could not load file or assembly 'accoremgd.dll' or one of its dependencies.

09-12-2012 03:42 AM in reply to: Alexander.Rivilis

Yes, I want to create standalone exe-file. And run AutoCAD 2013 in the background in the silent mode.

 

Yu

Moderator
Alexander.Rivilis
Posts: 1,417
Registered: ‎04-09-2008
Message 9 of 18 (3,368 Views)

Re: Could not load file or assembly 'accoremgd.dll' or one of its dependencies.

09-12-2012 03:47 AM in reply to: yuh0317

yuh0317 wrote:

Yes, I want to create standalone exe-file. And run AutoCAD 2013 in the background in the silent mode.

 

Yu


It is impossible using acdbmgd.dll, acmgd.dll and accoremgd.dll in standalone exe-file.

Its can be using only in dll-file which loaded into AutoCAD.

So you can use:

Autodesk.AutoCAD.Interop

Autodesk.AutoCAD.Interop.Common


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Active Contributor
yuh0317
Posts: 47
Registered: ‎12-03-2009
Message 10 of 18 (3,353 Views)

Re: Could not load file or assembly 'accoremgd.dll' or one of its dependencies.

09-12-2012 04:59 AM in reply to: Alexander.Rivilis

Actually I want to use some class in the acdbmgd.dll, acmgd.dll and accoremgd.dll in standalone exe-file. Do you know any other ways to use some class in the acdbmgd.dll, acmgd.dll and accoremgd.dll except load my dlls by AutoCAD.

 

YU

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 or visit the Installation and Licensing Forum to get help installing your software.