Microsoft Developer Network > Página Inicial dos Fóruns > Visual Studio Extensibility > TaskLoggingHelper LogError problem (MSBuild)
Fazer uma PerguntaFazer uma Pergunta
 

RespondidoTaskLoggingHelper LogError problem (MSBuild)

  • terça-feira, 30 de junho de 2009 22:13Dima.Zev Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hi i'm trying to build my Task vs msbuild and i has next problem

    i run in task class following code
    ...
     this.Log.LogError(String.Empty,String.Empty,String.Empty,fileAndPath,lineNum,0,lineNum+1, 0,message,String.Empty);
    ...

    in error window i got good entry, but in output window i got Error info in Wrong text format that is why when i double clicked on it i getting exception FileNot Foud (see below)
    my output : C:\dev\solution\consolapp\File1.cpp(19,2)Error: 
    supposed output : C:\dev\solution\consolapp\File1.cpp(19,2):  error

Respostas

  • sexta-feira, 3 de julho de 2009 8:27Nancy ShaoMSFT, ModeradorMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido
    Hi Dima,

    I have test the code:

    Log.LogError(String.Empty,String.Empty,String.Empty,1,2,3,4,message,String.Empty); 

    It works fine in my side, as the picture shows:



    So I can't reproduce your issue, could you please write a simple sample to reproduce this issue, and post here?


    Best Regards,
    Nancy

     
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

Todas as Respostas

  • quinta-feira, 2 de julho de 2009 9:06Nancy ShaoMSFT, ModeradorMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     

    Hi,

    Have you tired to use Log.LogError("Error Message" + fileAndPath +"("+ lineNum+","+ColumnNum + "):"+ ex.Message) ? Or delete the last String.Empty in sentence: this.Log.LogError(String.Empty,String.Empty,String.Empty,fileAndPath,lineNum,0,lineNum+1, 0,message,String.Empty);. Maybe the String.Empty in last is impact  the format of message string.

    Please let me know if it works fine.

    Best Regards,
    Nancy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • quinta-feira, 2 de julho de 2009 17:52Dima.Zev Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    First Case :Log.LogError("Error Message" + fileAndPath +"("+ lineNum+","+ColumnNum + "):"+ ex.Message)
     bad ,even prints error in  .vstargets file instead of my error message)

    Second case: delete the last String.Empty in sentence
     Still same problem

    _________________________________
    May be u know any hook, i mean event or overload any method to costomize output ?

    Thank you.

  • sexta-feira, 3 de julho de 2009 8:27Nancy ShaoMSFT, ModeradorMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido
    Hi Dima,

    I have test the code:

    Log.LogError(String.Empty,String.Empty,String.Empty,1,2,3,4,message,String.Empty); 

    It works fine in my side, as the picture shows:



    So I can't reproduce your issue, could you please write a simple sample to reproduce this issue, and post here?


    Best Regards,
    Nancy

     
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.