I am getting this weird error on Windows 10
when I try to build any project. The projects are working fine if I build them on other OS.
The specified task executable "cmd.exe" could not be run. The specified executable is not a valid application for this OS platform.
When I tried to check the log I got to the following code in Nuget.targets
file inside .nuget
folder, I commented the code and the project builds fine now. I don't understand why the error. Any new projects that I create are working fine...
I am using Visual Studio 2013
on Windows 8
, Windows Server 2008
and Visual Studio 2015
on Windows 10
.
Code:
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
I got the same error, and repairing the corrupted files solved my issue. Try this:
sfc /scannow
%windir%\Logs\CBS\CBS.log
. Confirm that it repaired cmd.exe. For me I saw something like this Repairing corrupted file [ml:48{24},l:46{23}]"\??\C:\WINDOWS\SysWOW64"\[l:14{7}]"cmd.exe" from store
DISM /Online /Cleanup-Image /RestoreHealth
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With