diff --git a/src/Build/Logging/LoggerDescription.cs b/src/Build/Logging/LoggerDescription.cs index a66ac147253..ef3a68959ab 100644 --- a/src/Build/Logging/LoggerDescription.cs +++ b/src/Build/Logging/LoggerDescription.cs @@ -89,7 +89,7 @@ internal int LoggerId /// /// This property generates the logger name by appending together the class name and assembly name /// - internal string Name + public string Name { get { @@ -104,7 +104,7 @@ internal string Name } else { - return _loggerAssembly.AssemblyFile; + return _loggerAssembly.AssemblyFile ?? _loggerAssembly.AssemblyName; } } } diff --git a/src/MSBuild.UnitTests/XMake_Tests.cs b/src/MSBuild.UnitTests/XMake_Tests.cs index ddc95774837..04726f5bb6a 100644 --- a/src/MSBuild.UnitTests/XMake_Tests.cs +++ b/src/MSBuild.UnitTests/XMake_Tests.cs @@ -2457,13 +2457,13 @@ public void MultipleTargetsDoesNotCrash() } [Theory] - [InlineData("-logger:,\"nonExistentlogger.dll\",IsOptional;Foo")] - [InlineData("-logger:ClassA,\"nonExistentlogger.dll\",IsOptional;Foo")] - [InlineData("-logger:,\"nonExistentlogger.dll\",IsOptional,OptionB,OptionC")] - [InlineData("-distributedlogger:,\"nonExistentlogger.dll\",IsOptional;Foo")] - [InlineData("-distributedlogger:ClassA,\"nonExistentlogger.dll\",IsOptional;Foo")] - [InlineData("-distributedlogger:,\"nonExistentlogger.dll\",IsOptional,OptionB,OptionC")] - public void MissingOptionalLoggersAreIgnored(string logger) + [InlineData("-logger:,\"nonExistentlogger.dll\",IsOptional;Foo", "nonExistentLogger.dll")] + [InlineData("-logger:ClassA,\"nonExistentlogger.dll\",IsOptional;Foo", "ClassA")] + [InlineData("-logger:,\"nonExistentlogger.dll\",IsOptional,OptionB,OptionC", "nonExistentLogger.dll")] + [InlineData("-distributedlogger:,\"nonExistentlogger.dll\",IsOptional;Foo", "nonExistentLogger.dll")] + [InlineData("-distributedlogger:ClassA,\"nonExistentlogger.dll\",IsOptional;Foo", "ClassA")] + [InlineData("-distributedlogger:,\"nonExistentlogger.dll\",IsOptional,OptionB,OptionC", "nonExistentLogger.dll")] + public void MissingOptionalLoggersAreIgnored(string logger, string expectedLoggerName) { string projectString = "" + @@ -2477,7 +2477,7 @@ public void MissingOptionalLoggersAreIgnored(string logger) var output = RunnerUtilities.ExecMSBuild(parametersLoggerOptional, out bool successfulExit, _output); successfulExit.ShouldBe(true); output.ShouldContain("Hello", customMessage: output); - output.ShouldContain("The specified logger could not be created and will not be used.", customMessage: output); + output.ShouldContain($"The specified logger \"{expectedLoggerName}\" could not be created and will not be used.", customMessage: output); } [Theory] diff --git a/src/MSBuild/Resources/Strings.resx b/src/MSBuild/Resources/Strings.resx index 98c41c4823c..0daf54d6adf 100644 --- a/src/MSBuild/Resources/Strings.resx +++ b/src/MSBuild/Resources/Strings.resx @@ -1398,10 +1398,11 @@ {StrBegin="MSBUILD : error MSB1058: "} - The specified logger could not be created and will not be used. {0} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.cs.xlf b/src/MSBuild/Resources/xlf/Strings.cs.xlf index 55929f8714c..228c52cc2f8 100644 --- a/src/MSBuild/Resources/xlf/Strings.cs.xlf +++ b/src/MSBuild/Resources/xlf/Strings.cs.xlf @@ -1473,11 +1473,12 @@ Když se nastaví na MessageUponIsolationViolation (nebo jeho krátký {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - Zadaný protokolovací nástroj nebylo možné vytvořit a nebude se používat. {0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.de.xlf b/src/MSBuild/Resources/xlf/Strings.de.xlf index 226e0960175..5c2513fe662 100644 --- a/src/MSBuild/Resources/xlf/Strings.de.xlf +++ b/src/MSBuild/Resources/xlf/Strings.de.xlf @@ -1461,11 +1461,12 @@ Dieses Protokollierungsformat ist standardmäßig aktiviert. {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - Die angegebene Protokollierung konnte nicht erstellt werden und wird nicht verwendet. {0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.es.xlf b/src/MSBuild/Resources/xlf/Strings.es.xlf index 1846d8646a1..e3a82328243 100644 --- a/src/MSBuild/Resources/xlf/Strings.es.xlf +++ b/src/MSBuild/Resources/xlf/Strings.es.xlf @@ -1467,11 +1467,12 @@ Esta marca es experimental y puede que no funcione según lo previsto. {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - No se pudo crear el registrador especificado y no se usará. {0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.fr.xlf b/src/MSBuild/Resources/xlf/Strings.fr.xlf index f4d88741a76..6e467e3e293 100644 --- a/src/MSBuild/Resources/xlf/Strings.fr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.fr.xlf @@ -1460,11 +1460,12 @@ Remarque : verbosité des enregistreurs d’événements de fichiers {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - Le journaliseur spécifié n'a pas pu être créé et ne sera pas utilisé. {0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.it.xlf b/src/MSBuild/Resources/xlf/Strings.it.xlf index 12e7aa2ac94..13e9b8a9025 100644 --- a/src/MSBuild/Resources/xlf/Strings.it.xlf +++ b/src/MSBuild/Resources/xlf/Strings.it.xlf @@ -1471,11 +1471,12 @@ Nota: livello di dettaglio dei logger di file {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - Non è stato possibile creare il logger specificato, che quindi non verrà usato. {0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.ja.xlf b/src/MSBuild/Resources/xlf/Strings.ja.xlf index cd05368111a..45167b4d7bb 100644 --- a/src/MSBuild/Resources/xlf/Strings.ja.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ja.xlf @@ -1460,11 +1460,12 @@ {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - 指定されたロガーを作成できなかったため、使用されません。{0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.ko.xlf b/src/MSBuild/Resources/xlf/Strings.ko.xlf index dfa81b71e90..4197b748bbc 100644 --- a/src/MSBuild/Resources/xlf/Strings.ko.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ko.xlf @@ -1460,11 +1460,12 @@ {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - 지정된 로거를 만들 수 없어 지정된 로거가 사용되지 않습니다. {0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.pl.xlf b/src/MSBuild/Resources/xlf/Strings.pl.xlf index 133760011df..f114835452f 100644 --- a/src/MSBuild/Resources/xlf/Strings.pl.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pl.xlf @@ -1471,11 +1471,12 @@ Ta flaga jest eksperymentalna i może nie działać zgodnie z oczekiwaniami. {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - Nie można utworzyć określonego rejestratora i nie zostanie on użyty. {0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf index 247e14490ef..827be3addcd 100644 --- a/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf +++ b/src/MSBuild/Resources/xlf/Strings.pt-BR.xlf @@ -1461,11 +1461,12 @@ arquivo de resposta. {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - Não foi possível criar o agente especificado e ele não será usado. {0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.ru.xlf b/src/MSBuild/Resources/xlf/Strings.ru.xlf index 1d89ce20f45..c788198b369 100644 --- a/src/MSBuild/Resources/xlf/Strings.ru.xlf +++ b/src/MSBuild/Resources/xlf/Strings.ru.xlf @@ -1459,11 +1459,12 @@ {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - Указанное средство ведения журнала не может быть создано и не будет использоваться. {0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.tr.xlf b/src/MSBuild/Resources/xlf/Strings.tr.xlf index d3fc5c7e9ed..b7f3ac3d53a 100644 --- a/src/MSBuild/Resources/xlf/Strings.tr.xlf +++ b/src/MSBuild/Resources/xlf/Strings.tr.xlf @@ -1464,11 +1464,12 @@ {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - Belirtilen günlükçü oluşturulamadığından kullanılamıyor. {0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf index 12f6f98c04d..3abbc22e275 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf @@ -1460,11 +1460,12 @@ {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - 无法创建指定的记录器,将不会使用它。{0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf index b603ad790a6..ef8d6ffab22 100644 --- a/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf @@ -1460,11 +1460,12 @@ {StrBegin="MSBUILD : error MSB1062: "}LOCALIZATION: The prefix "MSBUILD : error MSBxxxx:", "-warnnotaserror" and "-warnaserror" should not be localized. - The specified logger could not be created and will not be used. {0} - 無法建立指定的記錄器,且不會使用。{0} + The specified logger "{0}" could not be created and will not be used. {1} + The specified logger "{0}" could not be created and will not be used. {1} UE: This error is shown when a logger cannot be loaded and instantiated from its assembly. - LOCALIZATION: {0} contains the exception message explaining why the + LOCALIZATION: {0} contains the logger description passed on the command line or in a + response file. {1} contains the exception message explaining why the logger could not be created -- this message comes from the CLR/FX and is localized. diff --git a/src/MSBuild/XMake.cs b/src/MSBuild/XMake.cs index 8f2970dddd1..52dfea16312 100644 --- a/src/MSBuild/XMake.cs +++ b/src/MSBuild/XMake.cs @@ -4275,7 +4275,7 @@ private static bool CreateAndConfigureLogger( } catch (Exception e) when (loggerDescription.IsOptional) { - Console.WriteLine(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("OptionalLoggerCreationMessage", e.Message)); + Console.WriteLine(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("OptionalLoggerCreationMessage", loggerDescription.Name, e.Message)); return false; }