.NET

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

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

3625 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,623 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

 

 

Distinguished Mentor
gasty1001
Posts: 577
Registered: ‎04-11-2010
Message 3 of 18 (3,613 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,600 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,599 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,596 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,446
Registered: ‎04-09-2008
Message 7 of 18 (3,593 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,581 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,446
Registered: ‎04-09-2008
Message 9 of 18 (3,580 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,565 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

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!