IIS Expression错误:Could not load file or assembly … An attempt was made to load a program with an incorrect format

在Visual Studio 2015中跑IIS Express遇到错误:Could not load file or assembly … An attempt was made to load a program with an incorrect format.
尝试修改:(右键)Project-> Properties -> Build,将Build中的Platform target修改为Any CPU,无效。

解决方法如下:

Tools->Options->Projects and Solutions -> Web Projects,
将“Use the 64 bit version of IIS Express for web sites and projects”选上。

然后重新build solution,F5开始debug就可以了。

by Code问答