.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Could not load file or assembly 'Acdbmgd

5 REPLIES 5
Reply
Message 1 of 6
jitendrapratap_singh
203 Views, 5 Replies

Could not load file or assembly 'Acdbmgd

I am trying to develop a desktop application and by using AutoCAD dll trying to read DWG image attributes, by using .NET C# windows application, 

 

I am getting the below error

System.BadImageFormatException HResult=0x8007000B
Message=Could not load file or assembly 'Acdbmgd, Version=24.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source=CADWindowsApp
StackTrace:
at CADWindowsApp.AttributeReaderCommands.ReadAttributes() in D:\Demo\Automation_tool\CADWindowsApp\CADWindowsApp\Class1.cs:line 64
at CADWindowsApp.frmImage.button1_Click(Object sender, EventArgs e) in D:\Demo\Automation_tool\CADWindowsApp\CADWindowsApp\frmImage.cs:line 20
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at CADWindowsApp.Program.Main() in D:\Demo\Automation_tool\CADWindowsApp\CADWindowsApp\Program.cs:line 30

 

5 REPLIES 5
Message 2 of 6

It looks like you are trying to use the AutoCAD managed API from a standalone Windows executable. That's not possible, you can only use the AutoCAD managed API from a managed extension .DLL that is loaded into AutoCAD using the NETLOAD command.

Message 3 of 6

Actually, my requirement is to validate the DRG file from my .Net C# desktop application by checking certain attributes of the DRG file. that's why I am using the Autocad dll, Please can you suggest me some solution for that, How can I achieve it?
Message 4 of 6

From a standalone windows executable you can use the COM API, or you can build a hybrid application that involves both a standalone Windows executable and a managed extension component that can communicate with each other using COM.

 

You can find examples of using both approaches by searching this discussion group and this blog 

Message 5 of 6

Okay

Message 6 of 6

Would it be possible to use the "Autodesk Inventor" dll to create a desktop application to validate the 3D image dimension?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report