Problem description:
Cs0009: the metadata file "C: \ WINDOWS \ Microsoft. net \ Assembly \ gac_msil \ system. componentmodel. dataannotations \ v4.0 _ 4.0.0.0 _ 31bf3856ad364e35 \ system. componentmodel. dataannotations. DLL "--" try to load a program with an incorrect format.
The number of resources found on the internet is relatively small, and it is useless to fix vs. This small article is specially written.
I tried the following online methods:
Delete all files in the "C: \ WINDOWS \ Microsoft. NET \ framework \ v4.0.30319 \ temporary ASP. NET files" directory. No effect. A closer look is to solve the compilation problem. My webpage compilation is normal, but it cannot be displayed normally on the server that comes with. Exclude this solution.
Most of the solutions on the Internet are the above method. There is also a later version of Vs, which is still invalid after the trial.
Finally, try to replace the system. componentmodel. dataannotations. dll file and download it from the Internet.
Cs0009: failed to open the Metadata File System. componentmodel. dataannotations. dll and tried to load the program with incorrect format.