How do I get the MSBuild task to show up in the Visual Studio project output?

后端 未结 3 2000
星月不相逢
星月不相逢 2020-12-29 19:12

I\'m trying to printf debug my Visual Studio project file by spewing messages to the console like this:


  

        
相关标签:
3条回答
  • 2020-12-29 19:51

    Add the Importance attribute with value High to Message.

    Like this:

    <Message Importance="High" Text="+++ Justin Dearing +++" />
    
    0 讨论(0)
  • 2020-12-29 20:01

    For anyone reading this with MSBuild 16, bear in mind that you can't use message at the project level. You now need to first define InitialTargets

    <Project InitialTargets="Test" ...
    

    And then create a task to place the message in:

      <Target Name="Test">
          <Message Importance="High" Text="A Message" />
      </Target>
    
    0 讨论(0)
  • 2020-12-29 20:10

    To change the build output verbosity shown in the Visual Studio 2010 window, open the Options dialog and select the Build and Run settings below the Projects and Solutions node.

    Unless you explicitly specify a low message importance, your messages should show up at Normal verbosity or higher.

    0 讨论(0)
提交回复
热议问题