Consider the project
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets='repro'>
<Target Name = 'no_spaces'>
<Exec Command = 'echo C:\path\to\file.ext (5) error ERR999'/>
</Target>
<Target Name = 'spaces'>
<Exec Command = 'echo C:\path\to\file.ext (5) error ERR999:'/>
</Target>
<Target Name = 'repro'
DependsOnTargets = 'no_spaces;spaces'/>
</Project>
whose output includes the lines
MSBuild version 17.5.0+6f08c67f3 for .NET Framework
no_spaces:
echo C:\path\to\file.ext (5) error ERR999
C:\path\to\file.ext (5) error ERR999
spaces:
echo C:\path\to\file.ext (5) error ERR999:
C : \path\to\file.ext (5) error ERR999: [C:\path\to\msbuild.proj]
In my console the last line only is shown in red. Note the added spaces in the last line. Those spaces seem to prevent IDE problem matcher regex from finding those lines.
- Why is does the last line start with
C : \path
instead ofC:\path
? - Is there a way to prevent those spaces from being introduced?