Visual Studio 2012 csc.exe Error. Executable not valid for OS

后端 未结 10 2040
离开以前
离开以前 2020-12-20 14:21

I am getting the following error when trying to compile and test any type of project in Visual Studio 2012 Professional.

Error 1 The specified task executable \

10条回答
  •  忘掉有多难
    2020-12-20 14:39

    I had this exact problem today on my Win7 Machine. As Hans suggests, 'Navigate to C:\Windows\Microsoft.NET\Framework\v4.0.30319 and type "csc".'

    The file may still exist but if you can open it with notepad, it will probably show just plain text of some errors. This is the indication that your compiler has been destroyed. At my office we have come up with a theory that a Windows update may be causing this because only a few machines have been affected, but I haven't read much online about it until now.

    We fixed this by copying someone else's csc.exe into the C:\Windows\Microsoft.NET\Framework\v4.0.30319 directory and recompiling. Be sure to set the options on the file to read-only so this won't happen again. Good Luck!

提交回复
热议问题