[wix-users] Bad Image Format Exception

Habib Salim habib at hsalim.com
Tue Nov 14 06:07:38 PST 2017


Hi,

I have a custom action to create a few database objects.
This was working perfectly last week and I started adding a few more
functions and rebuilt the installer.
I got  BadImageFormatException and I just can't seem to get past it.  (see
detailed message below)


I reverted all the changes
Tried building the installer targeting the x86 platform, x64, Any CPU
In the config file for this project has        
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727"/>


I used Corflags.exe to verify that it was a 32bit dll, not 64bit

Nothing works.

I just cant figure it out.  please help.
Thanks 
Habib






--------------------------------------------------------------
Calling custom action
WixDbInstall!HSalimCo.CustomActions.EnumerateSqlServers
Error: could not load custom action class HSalimCo.CustomActions from
assembly: WixDbInstall
System.BadImageFormatException: Could not load file or assembly
'WixDbInstall' or one of its dependencies. This assembly is built by a
runtime newer than the currently loaded runtime and cannot be loaded.
File name: 'WixDbInstall'
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint,
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
forIntrospection)
   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.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
   at System.AppDomain.Load(String assemblyString)
   at
Microsoft.Deployment.WindowsInstaller.CustomActionProxy.GetCustomActionMet
hod(Session session, String assemblyName, String className, String
methodName)


More information about the wix-users mailing list