I have added a custom compiler in the build step for my Visual Studio 2017 project using a<CscToolExe>my_compiler.exe</CscToolExe>
tag in the csproj file. Everything is working great, except that I can't figure out how to make the compiler properly output information to Visual Studio's 'Build' output window. I've tried Console.Write, Debug.Write, and Trace.Write, but their output does not appear in the build output window. The only way I can get messages to appear in the log without any additional configuration in VS, is by formatting them as warnings or errors:
Console.Write("warning: Message LOGGED!");
Console.Write("error: Not a good place for a message...");
If I set the MSBuild verbosity to Normal/Detailed/Diagnostic, then I can see normal Console.Write output. But, the messages that I'm writing are of high importance and I would like them to always show up with the default 'Minimal' build verbosity setting. I'm aware that you can use
<Message Importance="High" Text="Look at me!!" />
In the MSBuild settings to make a message output to the log, but I have no idea how to get similar functionality from within my compiler.
In short, is there any way I can get the same build-verbosity-overriding functionality as Message.Importance using Console.Write or Debug.Write in my compiler? The fantasy function I wish I had:
Console.Write("My build message~", Importance.High);