locked
Exec task and "error :" in output RRS feed

  • Question

  • Hi,

    I just discovered a strange behavior of the exec task :

    <Exec Command="echo error : "/>

    will fail with code -1

    and

    <Exec Command="echo warning : " />

    will print a warning.


    Is it possible to disable this command output parsing ? I currently use ContinueOnError="True" but that modify my build logs.


    Regards,
    Ant1
    Wednesday, June 18, 2008 2:03 PM

Answers

  •  

    Hi Ant1,

    By default, MsBuild will format the warnings and errors which Visual Studio can then display. We can ignore this beahvior in 3.5 by setting the IgnoreStandardErrorWarningFormat parameter to True. Please try something like the following:

    <Exec Command="echo error:" IgnoreStandardErrorWarningFormat="true"/>

    Hope this helps.
    Best regards.
    Rong-Chun Zhang

    Windows Forms General FAQs
    Windows Forms Data Controls and Databinding FAQs


    Please mark the replies as answers if they help and unmark if they don't.
    • Proposed as answer by Feng Chen Monday, June 23, 2008 9:29 AM
    • Marked as answer by Ant1 Monday, June 23, 2008 12:11 PM
    • Marked as answer by Ant1 Monday, June 23, 2008 12:11 PM
    Monday, June 23, 2008 9:25 AM

All replies

  •  

    Hi Ant1,

    By default, MsBuild will format the warnings and errors which Visual Studio can then display. We can ignore this beahvior in 3.5 by setting the IgnoreStandardErrorWarningFormat parameter to True. Please try something like the following:

    <Exec Command="echo error:" IgnoreStandardErrorWarningFormat="true"/>

    Hope this helps.
    Best regards.
    Rong-Chun Zhang

    Windows Forms General FAQs
    Windows Forms Data Controls and Databinding FAQs


    Please mark the replies as answers if they help and unmark if they don't.
    • Proposed as answer by Feng Chen Monday, June 23, 2008 9:29 AM
    • Marked as answer by Ant1 Monday, June 23, 2008 12:11 PM
    • Marked as answer by Ant1 Monday, June 23, 2008 12:11 PM
    Monday, June 23, 2008 9:25 AM
  • Oh, thanks a lot !

    I am missing something in the msdn ? I don't see anything about it here : http://msdn.microsoft.com/en-us/library/x8zx72cd.aspx


    Thanks again,

    Ant1
    Monday, June 23, 2008 11:55 AM
  • I have similar problem that I have narrowed down to a trivial C++ console program

    #include <iostream>

    int main()

    {  std::cout << "error:" << std::endl; }

     

    If run using Ctrl F5, or from the IDe Debug, start without debugging, this produces the expected output "error:".

     

    But if run using a Post Build (or Custom ) command "$(TargetDir)$(TargetName).exe"
    it outputs 

    EXEC : error :

    and exits

    C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: The command ""J:\Cpp\math_constants\Debug\error_test.exe"

    C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: :VCEnd" exited with code -1.

    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped

    How can I prevent this?

    Where would I put

    IgnoreStandardErrorWarningFormat="true"/

    Thanks

     

    Paul

     

    PS I expect to have lots of projects and solutions with this problem.


    Paul A. Bristow
    Sunday, November 20, 2011 10:46 AM