The “Exec” task needs a command to execute.

Was getting the error “The “Exec” task needs a command to execute” while building a C#/C++ project in Visual Studio.

Problem turned out to be a stray newline in the Post-build step (I’d removed a copy but not cleared the newline)

 

CUDA Project Import Problem on Visual Studio 2019

I had a CUDA project that was running under Visual Studio 2017 and I moved to Visual Studio 2019, and got this error: –

The imported project “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 10.1.props” was not found

The problem was a missing extension that had been installed as part of the CUDA SDK. To solve it, copy this directory content…

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\visual_studio_integration\MSBuildExtensions

…into this directory: –

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations

Hope it helps!