Gents,
I was wondering if there is any way to configure the autocad.exe.config file so it works with the 32 bits version of .net framework. I'm developing an application for autocad 2008 32 bits in a 64 bits machine (windows 7) that gets some data from an access database (32 bits) therefore I'm getting the infamous "'microsoft.ace.oledb.12.0' provider is not registered on the local machine" error. Looking for a solution I've found that the only way to solve this is to target x86 machine in VS, but Autocad can't load the application because is reading the .net configuration from framework64 folder.
Update: This is the error I get in the autocad command line when the x86 application is loaded:
Cannot load assembly. Error details: System.BadImageFormatException: Could not
load file or assembly
'file:///C:\@Documentos\Personales\CODING\AutoCad\vb.net\OleDBTest\ClassLibrary1
\bin\Debug\ClassLibrary1.dll' or one of its dependencies. An attempt was made
to load a program with an incorrect format.
File name:
'file:///C:\@Documentos\Personales\CODING\AutoCad\vb.net\OleDBTest\ClassLibrary1
\bin\Debug\ClassLibrary1.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(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
at loadmgd()
=== Pre-bind state information ===
LOG: User = GLOBAL\rodrigo.cortes
LOG: Where-ref bind. Location =
C:\@Documentos\Personales\CODING\AutoCad\vb.net\OleDBTest\ClassLibrary1\bin\Debu
g\ClassLibrary1.dll
LOG: Appbase = file:///C:/Program Files/AutoCAD 2008/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will
only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Program Files\AutoCAD
2008\acad.exe.Config
LOG: Using machine configuration file from
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Attempting download of new URL
file:///C:/@Documentos/Personales/CODING/AutoCad/vb.net/OleDBTest/ClassLibrary1/
bin/Debug/ClassLibrary1.dll.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.