.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
32 bit dot net dlls in AutoCAD 64 bit on windows 7 64 bit machine - NetLoad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
My 32 bit Dot net application is working proper on Windows Xp 32 bit environment.
I want to load 32 bit dot net dlls in AutoCAD 64 bit on windows 7 64 bit machine
Now we are moving to support AutoCAD 64 bit on windows 7 platform (I built my DLLS in x86 platform but is getting error as follows).
When i try to NETLOAD following error is coming
Cannot load assembly. Error details: System.BadImageFormatException: Could not
load file or assembly 'file:///D:\Sample
Projects\LoadACAD\LoadACAD\bin\Debug\LoadACAD.dll' or one of its dependencies.
An attempt was made to load a program with an incorrect format.
File name: 'file:///D:\Sample Projects\LoadACAD\LoadACAD\bin\Debug\LoadACAD.dll'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyNa
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(Stri
at loadmgd()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure
logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
Re: 32 bit dot net dlls in AutoCAD 64 bit on windows 7 64 bit machine - NetLoad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Just change your target to "Any CPU" when you build your app, also things work best if you download ObjectARX and target your references to the acdbmgd.ll and acmdg.dll located in the ObjectARX 2011\inc folder. (mark to "Not Copy" when you build).
FL. Dept. of Transportation
CADD Applications Developer
HPxw4600 Workstation
Core 2 Duo 2.33ghz, 8gb RAM
nVidia Quadro FX1700
Win7 64bit
Re: 32 bit dot net dlls in AutoCAD 64 bit on windows 7 64 bit machine - NetLoad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Doing Any CPU settings it will create the DLLs in 64 bits and this will load the DLL without any Issue.
Issue is that i want to load 32 bit DLL as it is internally refering/loading 32 bit Dlls of another .Net Application.
Hope you got my point!
Re: 32 bit dot net dlls in AutoCAD 64 bit on windows 7 64 bit machine - NetLoad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Well, if the DLL you have to reference was specifically compiled targeting 32-bit CPU, then you cannot use it in your 64-bit AutoCAD process. Had your app is a stand-alone app, not an Acad add-in, then your app can just runa s 32-bit app (because of the must-reference 32-bit DLL) on Win 64-bit OS, just like other 32-bit apps run on Win64. However, you are developing in-process program for 64-bi AutoCAD, all code used must be 64-bit capable.
So, you either recompile that must-reference DLL to target Any CPU or x64, or choose not use that 32-bit specific DLL, if that DLL somehow uses 32-bit COM/native interop.
Here is an article that may be of help:
Re: 32 bit dot net dlls in AutoCAD 64 bit on windows 7 64 bit machine - NetLoad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
The .net dlls I compile with "Any CPU" run fine on both 32 & 64bit without recompiling. I am targeting the reference dlls from the ObjectARX\inc folder (not a specific bit version).
FL. Dept. of Transportation
CADD Applications Developer
HPxw4600 Workstation
Core 2 Duo 2.33ghz, 8gb RAM
nVidia Quadro FX1700
Win7 64bit
Re: 32 bit dot net dlls in AutoCAD 64 bit on windows 7 64 bit machine - NetLoad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
In my case the DLL I am calling from Autocad uses an 32bits activeX componente that I have not the source code.
Even if I put AnyCPU to my DLL, when Autocad try to load my DLL gives my an error.
Is there any solution?
Maitere
Re: 32 bit dot net dlls in AutoCAD 64 bit on windows 7 64 bit machine - NetLoad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
If your AutoCAD is 64-bit, then you cannot use 32-bit ActiveX component. Period. You need to find either 64-bit Activex Component, or a .NET version of equivalent.
Re: 32 bit dot net dlls in AutoCAD 64 bit on windows 7 64 bit machine - NetLoad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
maiterela wrote:In my case the DLL I am calling from Autocad uses an 32bits activeX componente that I have not the source code.
Even if I put AnyCPU to my DLL, when Autocad try to load my DLL gives my an error.
Is there any solution?
Maitere
Unfortunately, not. 32 bit ActiveX controls cannot be used in 64 bit applications.
Having a dependence on ActiveX controls, especially those which you don't have control over, has always been a risky proposition.
Re: 32 bit dot net dlls in AutoCAD 64 bit on windows 7 64 bit machine - NetLoad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I don't want to use Autocad32bits in a 64bits operating system. The autocad I am using is 64bit but I have an add-in that use 32bits activeX controls. Does these tools (Longbow Converter) help in cases too?
Re: 32 bit dot net dlls in AutoCAD 64 bit on windows 7 64 bit machine - NetLoad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
No, Longbow Converter DOES nto help you here: it is for running 32-bit AutoCAD with 64-bit OS. If you insist on using 64-bit AutoCAD with 64-bit OS (usually you should), you MUST give up the 32-bit activeX control. End of story.

