Project development now always needs to be developed under X64, so we need to debug in IIS Express. Do not always put in IIS, so slow in attach.
If you do not set the program to debug X64 directly, we may be subject to the following similar error
"Failed to load file or assembly" MvcApplication2 "or one of its dependencies. An attempt was made to load a program that is not properly formatted. ”
Graphical
Modify the Registration Form
Open "Run" and enter "RegEdit" to open Registry Editor.
Navigate to: "Hkey_current_user\software\microsoft\visualstudio\14.0\webprojects"
Make sure there is a value named "Use64bitiisexpress" REG_DWORD. If not, create it.
The value that modifies the entry's cardinality to 16 is 1 (the default value is =0). Now you can debug a 64-bit website.
Reference
VS2013 Unable to start IIS Express Web Solution
VisualStudio 2015 Open IIS Express to debug X64 project