Could not load file or assembly 'xxx' or one of its dependencies. An attempt was made to load a program with an incorrect format

前端 未结 9 618
情歌与酒
情歌与酒 2020-11-27 12:29

I just checked out a revision from Subversion to a new folder. Opened the solution and I get this when run:

Could not load file or assembly \'xxxx\' or one

相关标签:
9条回答
  • 2020-11-27 13:13

    Sounds like one part of the project is being built for x86-only while the rest is being built for any CPU/x64. This bit me, too. Are you running an x64 (or uh... IA64)?

    Check the project properties and make sure everything is being built for "Any CPU". f you're in Visual Studio, you can check for everything by going to the "x86" or "Any CPU" menu (next to the "Debug"/"Release" menu) on the toolbar at the top of the screen and clicking "Configuration Manager..."

    0 讨论(0)
  • 2020-11-27 13:13

    I had this error when trying to use the dreadful Business Objects 4 for .Net SDK.

    They ship five BusinessObjects*.dll files, but all of them are 64-bit.

    To get my webpage to load, I needed to click on Tools\Options, then change this setting in VS2013:

    0 讨论(0)
  • 2020-11-27 13:14

    The BadImageFormatException on an application running on IIS (not running from VS, since visual studio fixes the problem by using the build for "Any CPU") can be caused by the following:

    The site is one a server that is x64 and the Application Pool's default setting for Enable 32-Bit Applications was False. and you have 32-bit assemblies

    On the level of Visual Studio, the fix is:

    1. Change the project setting "Target CPU" to "ANYCPU"
    0 讨论(0)
提交回复
热议问题