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 648
情歌与酒
情歌与酒 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: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"

提交回复
热议问题