Skip to content

The System.BadImageFormatException exception

Jingwood edited this page Mar 15, 2021 · 1 revision

Error

If the following exception caused when application starting up, try to change the platform target from 'Any CPU' to 'x86' in project settings.

System.BadImageFormatException: 'Could not load file or assembly 'd2dwinform, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null'. An attempt was made to load a program with an incorrect format.'

Solution

  1. Open project settings
  2. Switch to 'Build' property page
  3. Change 'Platform target' to 'x86'

Tips: You can create a new Configuration by copying from 'Any CPU' before the above change.

Clone this wiki locally