.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 6
Anonymous
836 Views, 5 Replies

Error

An unhandled exception of type 'System.BadImageFormatException' occurred in System.Windows.Forms.dll

Additional information: Could not load file or assembly 'Acdbmgd, Version=20.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

 

 

How to solve this error 

5 REPLIES 5
Message 2 of 6
norman.yuan
in reply to: Anonymous

You really need to post a bit more details/descriptions of what you are doing, such as:

 

Are you doing AutoCAD .NET API add-in (which is the main topic of this forum)? Or are  you doing stand-alone EXE app and trying to use AutoCAD .NET API?

 

Which version of AutoCAD do you use for development and which version of AutoCAD that runs into this error (in debugging, or in real use)?

 

If I had to guess, I would guess that you are doing EXE WIN FORM app with setting references to AutoCAD's .NET API assemblies (acdbmgd.dll and others). If so, the error is expected: AutoCAD .NET API assemblies CANNOT be used in EXE app.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 6
ActivistInvestor
in reply to: Anonymous

The AutoCAD .NET API cannot be used from a standalone EXE.  They can only be used from a DLL that is loaded into AutoCAD using the NETLOAD command.

 


@Anonymous wrote:

An unhandled exception of type 'System.BadImageFormatException' occurred in System.Windows.Forms.dll

Additional information: Could not load file or assembly 'Acdbmgd, Version=20.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

 

 

How to solve this error 


 

Message 4 of 6
Anonymous
in reply to: norman.yuan

yes this windows application i used autocad 2015 and Microsoft visual
Studio 2015. I used all dll required for run code env but they can not run
. how to insert autocad api ? How can i do it .
Message 5 of 6
norman.yuan
in reply to: Anonymous


@Anonymous wrote:
...
. how to insert autocad api ? How can i do it .

AutoCAD provides different sets of APIs. Using MS .NET framework/Visual Studio does not necessarily mean that you can use AutoCAD .NET API in EXE application. 

 

If you have to control/automate AutoCAD from external EXE app, you use AutoCAD COM API.

 

I'd suggest to learn more about using AutoCAD, then programming AutoCAD before jumping right in Visual Studio to write code. After some due study, you might realize that using EXE  app to automate AutoCAD may not be a good solution (in most cases, IMO).

Norman Yuan

Drive CAD With Code

EESignature

Message 6 of 6
ActivistInvestor
in reply to: Anonymous

Learn the basics of AutoCAD programming, including the various APIs (COM/ActiveX, .NET, etc) and become familiar with them to the degree that you can build a basic application.

 

You are trying to automate AutoCAD with little-to-no familiarity with its APIs, which is not going to work.

 


@Anonymous wrote:
yes this windows application i used autocad 2015 and Microsoft visual
Studio 2015. I used all dll required for run code env but they can not run
. how to insert autocad api ? How can i do it .

 

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

Post to forums  

Forma Design Contest


AutoCAD Beta