You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a dotnet test run on our CI, we get the following exception:
MSBUILD : error MSB4017: The build stopped unexpectedly because of an unexpected logger failure.
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
at Microsoft.Build.Logging.TerminalLogger.TerminalLogger.WrapText(StringBuilder sb, String text, Int32 maxLength, String indent)
at Microsoft.Build.Logging.TerminalLogger.TerminalLogger.FormatEventMessage(String category, String subcategory, String message, String code, String file, Int32 lineNumber, Int32 endLineNumber, Int32 columnNumber, Int32 endColumnNumber, String indent)
at Microsoft.Build.Logging.TerminalLogger.TerminalLogger.FormatErrorMessage(BuildErrorEventArgs e, String indent)
at Microsoft.Build.Logging.TerminalLogger.TerminalLogger.ErrorRaised(Object sender, BuildErrorEventArgs e)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseErrorEvent(Object sender, BuildErrorEventArgs buildEvent)
Steps to Reproduce
Steps to reproduce:
Use the attached project (it's a single csproj which output a multiline text) ConsoleApp1.zip
Use cmd.exe to be able to change the terminal width
Change the terminal size via the mode command: mode 2,50
Run dotnet build to build the attached project
💥
Expected Behavior
MSBuild should not throw an exception.
Actual Behavior
MSBuild throws the following exception:
MSBUILD : error MSB4017: The build stopped unexpectedly because of an unexpected logger failure.
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
at Microsoft.Build.Logging.TerminalLogger.TerminalLogger.WrapText(StringBuilder sb, String text, Int32 maxLength, String indent)
at Microsoft.Build.Logging.TerminalLogger.TerminalLogger.FormatEventMessage(String category, String subcategory, String message, String code, String file, Int32 lineNumber, Int32 endLineNumber, Int32 columnNumber, Int32 endColumnNumber, String indent)
at Microsoft.Build.Logging.TerminalLogger.TerminalLogger.FormatErrorMessage(BuildErrorEventArgs e, String indent)
at Microsoft.Build.Logging.TerminalLogger.TerminalLogger.ErrorRaised(Object sender, BuildErrorEventArgs e)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseErrorEvent(Object sender, BuildErrorEventArgs buildEvent)
Analysis
Looking at the code for TerminalLogger.WrapText, the only possible cause is that the Terminal width is smaller than the indentation. I'm not sure how that happens on our CI, but in any case the TerminalLogger should be robust to this situation.
Versions & Configurations
$ dotnet --version
9.0.101
$ msbuild --version
MSBuild version 17.12.12+1cce77968 for .NET Framework
17.12.12.57101
Issue Description
On a
dotnet test
run on our CI, we get the following exception:Steps to Reproduce
Steps to reproduce:
cmd.exe
to be able to change the terminal widthmode
command:mode 2,50
dotnet build
to build the attached projectExpected Behavior
MSBuild should not throw an exception.
Actual Behavior
MSBuild throws the following exception:
Analysis
Looking at the code for
TerminalLogger.WrapText
, the only possible cause is that the Terminal width is smaller than the indentation. I'm not sure how that happens on our CI, but in any case the TerminalLogger should be robust to this situation.Versions & Configurations
$ dotnet --version
9.0.101
$ msbuild --version
MSBuild version 17.12.12+1cce77968 for .NET Framework
17.12.12.57101
Similar issues
I found #8913 which looks similar.
The text was updated successfully, but these errors were encountered: