What does the error "the exec task needs a command to execute" mean?

C#.NetExceptionCompiler Construction

C# Problem Overview


When compiling a project in Visual Studio, the error message "the exec task needs a command to execute" appears, with no line number. What does this error mean?

(Apologies for asking and answering my own question; I just found an answer as I was writing this. Have made it community wiki, so as not to offend.)

C# Solutions


Solution 1 - C#

Ken Egozi has found an answer.

The message is caused by stray newline characters in pre or post build commands.

Solution 2 - C#

That link is no longer good.
HERE is a new link.

And here is a pertinent quote from the blog:
"After pooling out a few hairs, I remembers that I recently have edited the pre-build actions for this project. Looking this up, I found that I left a spare newline at the end of the pre-build script. So VS2005 sent msbuild an order to run an empty command."

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRichie CottonView Question on Stackoverflow
Solution 1 - C#Richie CottonView Answer on Stackoverflow
Solution 2 - C#claudekennilolView Answer on Stackoverflow