Skip to content

[Bug]: TerminalLogger "on" and "off" are not recognized, results in resource errors. #9150

@tbolon

Description

@tbolon

Issue Description

When using the TerminalLogger /tl argument, only the auto (or nothing) works. All other values (on or off) results in a resource error:

  • "MSB0001: Internal MSBuild Error: Missing resource 'InvalidTerminalLoggerValue'" when using msbuild
  • "MSB0001: Internal MSBuild Error: Missing resource 'InvalidLiveLoggerValue'" when using dotnet build

I suppose the difference in the resource name is because of #8915 and difference in version between dotnet and msbuild.

So there are two problems here:

  • "on" and "off" values are not supported (I suppose), the documentation should be updated (it seems to have been replaced with "true" or "false"
  • the resource lookup for the error message fails

Steps to Reproduce

dotnet new console -o ConsoleApp8
cd ConsoleApp8
msbuild -tl:on
dotnet build -tl:on

Expected Behavior

compilation succeed with terminallogger enabled.

Actual Behavior

> dotnet build /tl:on
MSBuild version 17.8.0-preview-23367-03+0ff2a83e9 for .NET
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Missing resource 'InvalidLiveLoggerValue'
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
   at Microsoft.Build.Shared.ErrorUtilities.VerifyThrow(Boolean condition, String unformattedMessage, Object arg0)
   at Microsoft.Build.Shared.AssemblyResources.GetString(String name)
   at Microsoft.Build.Shared.ResourceUtilities.FormatResourceStringStripCodeAndKeyword(String& code, String& helpKeyword, String resourceName, Object[] args)
   at Microsoft.Build.Shared.ResourceUtilities.FormatResourceStringStripCodeAndKeyword(String resourceName, Object[] args)
   at Microsoft.Build.CommandLine.CommandLineSwitchException.Throw(String messageResourceName, String commandLineArg, String[] messageArgs)
   at Microsoft.Build.CommandLine.CommandLineSwitchException.Throw(String messageResourceName, String commandLineArg)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessLiveLoggerConfiguration(CommandLineSwitches commandLineSwitches)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessCommandLineSwitches(CommandLineSwitches switchesFromAutoResponseFile, CommandLineSwitches switchesNotFromAutoResponseFile, String& projectFile, String[]& targets, String& toolsVersion, Dictionary`2& globalProperties, ILogger[]& loggers, LoggerVerbosity& verbosity, LoggerVerbosity& originalVerbosity, List`1& distributedLoggerRecords, Int32& cpuCount, Boolean& enableNodeReuse, TextWriter& preprocessWriter, TextWriter& targetsWriter, Boolean& detailedSummary, ISet`1& warningsAsErrors, ISet`1& warningsNotAsErrors, ISet`1& warningsAsMessages, Boolean& enableRestore, Boolean& interactive, ProfilerLogger& profilerLogger, Boolean& enableProfiler, Dictionary`2& restoreProperties, ProjectIsolationMode& isolateProjects, GraphBuildOptions& graphBuild, String[]& inputResultsCaches, String& outputResultsCache, Boolean& lowPriority, Boolean& question, Boolean recursing, String commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Unhandled exception: Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Missing resource 'InvalidLiveLoggerValue'
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
   at Microsoft.Build.Shared.ErrorUtilities.VerifyThrow(Boolean condition, String unformattedMessage, Object arg0)
   at Microsoft.Build.Shared.AssemblyResources.GetString(String name)
   at Microsoft.Build.Shared.ResourceUtilities.FormatResourceStringStripCodeAndKeyword(String& code, String& helpKeyword, String resourceName, Object[] args)
   at Microsoft.Build.Shared.ResourceUtilities.FormatResourceStringStripCodeAndKeyword(String resourceName, Object[] args)
   at Microsoft.Build.CommandLine.CommandLineSwitchException.Throw(String messageResourceName, String commandLineArg, String[] messageArgs)
   at Microsoft.Build.CommandLine.CommandLineSwitchException.Throw(String messageResourceName, String commandLineArg)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessLiveLoggerConfiguration(CommandLineSwitches commandLineSwitches)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessCommandLineSwitches(CommandLineSwitches switchesFromAutoResponseFile, CommandLineSwitches switchesNotFromAutoResponseFile, String& projectFile, String[]& targets, String& toolsVersion, Dictionary`2& globalProperties, ILogger[]& loggers, LoggerVerbosity& verbosity, LoggerVerbosity& originalVerbosity, List`1& distributedLoggerRecords, Int32& cpuCount, Boolean& enableNodeReuse, TextWriter& preprocessWriter, TextWriter& targetsWriter, Boolean& detailedSummary, ISet`1& warningsAsErrors, ISet`1& warningsNotAsErrors, ISet`1& warningsAsMessages, Boolean& enableRestore, Boolean& interactive, ProfilerLogger& profilerLogger, Boolean& enableProfiler, Dictionary`2& restoreProperties, ProjectIsolationMode& isolateProjects, GraphBuildOptions& graphBuild, String[]& inputResultsCaches, String& outputResultsCache, Boolean& lowPriority, Boolean& question, Boolean recursing, String commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
   at Microsoft.DotNet.Cli.Utils.MSBuildForwardingAppWithoutLogging.ExecuteInProc(String[] arguments) 
> msbuild /tl:on
MSBuild version 17.8.0-preview-23376-06+f413f5497 for .NET Framework
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Missing resource 'InvalidTerminalLoggerValue'
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
   at Microsoft.Build.Shared.ErrorUtilities.VerifyThrow(Boolean condition, String unformattedMessage, Object arg0)
   at Microsoft.Build.Shared.AssemblyResources.GetString(String name)
   at Microsoft.Build.Shared.ResourceUtilities.FormatResourceStringStripCodeAndKeyword(String& code, String& helpKeyword, String resourceName, Object[] args)
   at Microsoft.Build.CommandLine.CommandLineSwitchException.Throw(String messageResourceName, String commandLineArg, String[] messageArgs)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessTerminalLoggerConfiguration(CommandLineSwitches commandLineSwitches)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessCommandLineSwitches(CommandLineSwitches switchesFromAutoResponseFile, CommandLineSwitches switchesNotFromAutoResponseFile, String& projectFile, String[]& targets, String& toolsVersion, Dictionary`2& globalProperties, ILogger[]& loggers, LoggerVerbosity& verbosity, LoggerVerbosity& originalVerbosity, List`1& distributedLoggerRecords, Boolean& needToValidateProject, String& schemaFile, Int32& cpuCount, Boolean& enableNodeReuse, TextWriter& preprocessWriter, TextWriter& targetsWriter, Boolean& detailedSummary, ISet`1& warningsAsErrors, ISet`1& warningsNotAsErrors, ISet`1& warningsAsMessages, Boolean& enableRestore, Boolean& interactive, ProfilerLogger& profilerLogger, Boolean& enableProfiler, Dictionary`2& restoreProperties, ProjectIsolationMode& isolateProjects, GraphBuildOptions& graphBuild, String[]& inputResultsCaches, String& outputResultsCache, Boolean& lowPriority, Boolean& question, Boolean recursing, String commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)

Unhandled Exception: Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Missing resource 'InvalidTerminalLoggerValue'
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
   at Microsoft.Build.Shared.ErrorUtilities.VerifyThrow(Boolean condition, String unformattedMessage, Object arg0)
   at Microsoft.Build.Shared.AssemblyResources.GetString(String name)
   at Microsoft.Build.Shared.ResourceUtilities.FormatResourceStringStripCodeAndKeyword(String& code, String& helpKeyword, String resourceName, Object[] args)
   at Microsoft.Build.CommandLine.CommandLineSwitchException.Throw(String messageResourceName, String commandLineArg, String[] messageArgs)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessTerminalLoggerConfiguration(CommandLineSwitches commandLineSwitches)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessCommandLineSwitches(CommandLineSwitches switchesFromAutoResponseFile, CommandLineSwitches switchesNotFromAutoResponseFile, String& projectFile, String[]& targets, String& toolsVersion, Dictionary`2& globalProperties, ILogger[]& loggers, LoggerVerbosity& verbosity, LoggerVerbosity& originalVerbosity, List`1& distributedLoggerRecords, Boolean& needToValidateProject, String& schemaFile, Int32& cpuCount, Boolean& enableNodeReuse, TextWriter& preprocessWriter, TextWriter& targetsWriter, Boolean& detailedSummary, ISet`1& warningsAsErrors, ISet`1& warningsNotAsErrors, ISet`1& warningsAsMessages, Boolean& enableRestore, Boolean& interactive, ProfilerLogger& profilerLogger, Boolean& enableProfiler, Dictionary`2& restoreProperties, ProjectIsolationMode& isolateProjects, GraphBuildOptions& graphBuild, String[]& inputResultsCaches, String& outputResultsCache, Boolean& lowPriority, Boolean& question, Boolean recursing, String commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main()

Analysis

Perhaps related to #9119 ?

Versions & Configurations

> msbuild -version
MSBuild version 17.8.0-preview-23376-06+f413f5497 for .NET Framework
17.8.0.37606
> dotnet --version
8.0.100-preview.7.23376.3

Metadata

Metadata

Assignees

Labels

bugneeds-triageHave yet to determine what bucket this goes in.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions