diff --git a/src/Microsoft.TemplateEngine.Cli/CliConsoleFormatter.cs b/src/Microsoft.TemplateEngine.Cli/CliConsoleFormatter.cs index ed6f808357..d1fa72f4d5 100644 --- a/src/Microsoft.TemplateEngine.Cli/CliConsoleFormatter.cs +++ b/src/Microsoft.TemplateEngine.Cli/CliConsoleFormatter.cs @@ -99,7 +99,14 @@ private void WriteExceptionDetails(TextWriter textWriter, in LogEntry + /// Looks up a localized string similar to Failed to load dotnet CLI host data for template {0} from cache.. + /// + internal static string HostSpecificDataLoader_Warning_FailedToRead { + get { + return ResourceManager.GetString("HostSpecificDataLoader_Warning_FailedToRead", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored.. + /// + internal static string HostSpecificDataLoader_Warning_FailedToReadFromFile { + get { + return ResourceManager.GetString("HostSpecificDataLoader_Warning_FailedToReadFromFile", resourceCulture); + } + } + /// /// Looks up a localized string similar to Installs a source or a template package.. /// diff --git a/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.resx b/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.resx index 80262f66b8..6f4e5dd5e9 100644 --- a/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.resx +++ b/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.resx @@ -761,4 +761,12 @@ The supported columns are: language, tags, author, type. Invalid command syntax: use '{0}' instead. {0} - command syntax, example: dotnet new [PARTIAL_NAME] --list [FILTER_OPTIONS]. - + + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + + \ No newline at end of file diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.cs.xlf index 16f3b27610..85da9351ed 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.cs.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.cs.xlf @@ -515,6 +515,16 @@ Pokud si chcete zobrazit všechny aliasy, spusťte bez argumentů příkaz dotne Příklady: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. Nainstaluje zdroj nebo balíček šablon. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.de.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.de.xlf index 6d775a7bef..45e3f94214 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.de.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.de.xlf @@ -515,6 +515,16 @@ Führen Sie "dotnet {1}--show-aliases" ohne Argumente aus, um alle Aliase anzuze Beispiele: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. Installiert ein Quell- oder Vorlagenpaket. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.es.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.es.xlf index 2062b9fd50..262c3e94eb 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.es.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.es.xlf @@ -515,6 +515,16 @@ Ejecute "dotnet {1} --show-aliases" sin argumentos para mostrar todos los alias. Ejemplos: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. Instala un paquete de origen o de plantilla. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.fr.xlf index cf60de824f..1cdf73119b 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.fr.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.fr.xlf @@ -515,6 +515,16 @@ Exécutez « dotnet {1} --show-aliases » sans arguments pour afficher tous le Exemples : + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. Installe une source ou un package de modèle. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.it.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.it.xlf index 43eb2a8a0d..98d4f9f9b9 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.it.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.it.xlf @@ -515,6 +515,16 @@ Eseguire 'dotnet {1}--show-alias ' senza argomenti per mostrare tutti gli alias. Esempi: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. Installa un pacchetto di origine o di modello. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ja.xlf index 89a5342977..f4b84fdc96 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ja.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ja.xlf @@ -515,6 +515,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. 例: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. ソースまたはテンプレート パッケージをインストールします。 diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ko.xlf index fbbca5f31a..1f103320ca 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ko.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ko.xlf @@ -515,6 +515,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. 예: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. 소스 또는 템플릿 패키지를 설치합니다. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pl.xlf index f207633e08..5b1352ea0e 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pl.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pl.xlf @@ -515,6 +515,16 @@ Uruchom polecenie "dotnet {1}--show-aliases" bez argumentów, aby wyświetlić w Przykłady: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. Instaluje źródło lub pakiet szablonów. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pt-BR.xlf index 12603cae38..04cc656d04 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pt-BR.xlf @@ -515,6 +515,16 @@ Execute 'dotnet {1} --mostrar- aliases' sem nenhum args para mostrar todos os al Exemplos: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. Instala um pacote de origem ou de modelo. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ru.xlf index c1d1122c1d..7cb25733e0 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ru.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ru.xlf @@ -515,6 +515,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. Примеры: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. Устанавливает источник или пакет шаблона. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.tr.xlf index 39e2ca2fb4..1329d6074c 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.tr.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.tr.xlf @@ -515,6 +515,16 @@ Tüm diğer adları göstermek için 'dotnet {1} --show-aliases' komutunu bağı Örnekler: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. Bir kaynak veya şablon paketi yükler. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hans.xlf index e0df8723df..241ca6137c 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hans.xlf @@ -515,6 +515,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. 示例: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. 安装源或模板包。 diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hant.xlf index bd24c3f054..b6543f2b1d 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hant.xlf @@ -515,6 +515,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. 範例: + + Failed to load dotnet CLI host data for template {0} from cache. + Failed to load dotnet CLI host data for template {0} from cache. + {0} - template short name + + + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. + {0} - template short name, {1} - file path to host data. + Installs a source or a template package. 安裝來源或範本套件。 diff --git a/src/Microsoft.TemplateEngine.Edge/LocalizableStrings.Designer.cs b/src/Microsoft.TemplateEngine.Edge/LocalizableStrings.Designer.cs index 9d69a528f1..90233fef5d 100644 --- a/src/Microsoft.TemplateEngine.Edge/LocalizableStrings.Designer.cs +++ b/src/Microsoft.TemplateEngine.Edge/LocalizableStrings.Designer.cs @@ -382,6 +382,15 @@ internal static string TemplateCreator_TemplateCreationResult_Error_DestructiveC } } + /// + /// Looks up a localized string similar to Failed to load host data in {0} at {1}.. + /// + internal static string TemplateInfo_Warning_FailedToReadHostData { + get { + return ResourceManager.GetString("TemplateInfo_Warning_FailedToReadHostData", resourceCulture); + } + } + /// /// Looks up a localized string similar to Failed to scan {0}. ///Details: {1}. diff --git a/src/Microsoft.TemplateEngine.Edge/LocalizableStrings.resx b/src/Microsoft.TemplateEngine.Edge/LocalizableStrings.resx index 6a94ad3eb1..e6962ce4b6 100644 --- a/src/Microsoft.TemplateEngine.Edge/LocalizableStrings.resx +++ b/src/Microsoft.TemplateEngine.Edge/LocalizableStrings.resx @@ -228,6 +228,10 @@ Details: {0}. Destructive changes detected. + + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/Settings/TemplateInfo.cs b/src/Microsoft.TemplateEngine.Edge/Settings/TemplateInfo.cs index 4cf6b343e3..7bfc96d0be 100644 --- a/src/Microsoft.TemplateEngine.Edge/Settings/TemplateInfo.cs +++ b/src/Microsoft.TemplateEngine.Edge/Settings/TemplateInfo.cs @@ -113,7 +113,11 @@ internal TemplateInfo(ITemplate template, ILocalizationLocator? localizationInfo } catch (Exception ex) { - logger.LogDebug(ex, $"Failed to load HostConfig in {template.TemplateSourceRoot.MountPoint.MountPointUri} at {template.HostConfigPlace}."); + logger.LogWarning( + ex, + LocalizableStrings.TemplateInfo_Warning_FailedToReadHostData, + template.MountPointUri, + template.HostConfigPlace); } } } diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.cs.xlf index 7f2c737ebc..47b6827b46 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.cs.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.cs.xlf @@ -185,6 +185,11 @@ Podrobnosti: {0}. Rozpoznaly se destruktivní změny. + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.de.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.de.xlf index 1dc32737c3..f0be4eac59 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.de.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.de.xlf @@ -185,6 +185,11 @@ Details: {0}. Es wurden destruktive Änderungen erkannt. + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.es.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.es.xlf index dbae887990..a301457857 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.es.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.es.xlf @@ -185,6 +185,11 @@ Detalles: {0}. Cambios destructivos detectados. + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.fr.xlf index 2389e71a75..cf7dd538b5 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.fr.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.fr.xlf @@ -185,6 +185,11 @@ Détails : {0}. Modifications destructrices détectées. + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.it.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.it.xlf index a35771ece7..585057dee5 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.it.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.it.xlf @@ -185,6 +185,11 @@ Dettagli: {0}. Rilevate modifiche distruttive. + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ja.xlf index 1625f7e298..3aa35310e6 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ja.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ja.xlf @@ -185,6 +185,11 @@ Details: {0}. 重大な変更が検出されました。 + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ko.xlf index dcdfa91160..8dce5d30b4 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ko.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ko.xlf @@ -185,6 +185,11 @@ Details: {0}. 파괴적 변경이 감지되었습니다. + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.pl.xlf index a1394c0e09..02706b310a 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.pl.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.pl.xlf @@ -185,6 +185,11 @@ Szczegóły: {0}. Wykryto niszczące zmiany. + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.pt-BR.xlf index 2b61c9f644..75e6bf8dea 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.pt-BR.xlf @@ -185,6 +185,11 @@ Detalhes: {0}. Alterações destrutivas detectadas. + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ru.xlf index 3f3024cc6c..565838f3bc 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ru.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.ru.xlf @@ -185,6 +185,11 @@ Details: {0}. Обнаружены необратимые изменения. + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.tr.xlf index 95383a41f7..075bd3bfb8 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.tr.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.tr.xlf @@ -185,6 +185,11 @@ Ayrıntılar: {0}. Zararlı değişiklikler algılandı. + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.zh-Hans.xlf index f13951496a..d12fa1c040 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.zh-Hans.xlf @@ -185,6 +185,11 @@ Details: {0}. 检测到破坏性更改。 + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.zh-Hant.xlf index 7eabb39e7d..92d743f621 100644 --- a/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Microsoft.TemplateEngine.Edge/xlf/LocalizableStrings.zh-Hant.xlf @@ -185,6 +185,11 @@ Details: {0}. 偵測到破壞性變更。 + + Failed to load host data in {0} at {1}. + Failed to load host data in {0} at {1}. + {0} - path to template location, {1} relative path inside template location. + Failed to scan {0}. Details: {1} diff --git a/src/Microsoft.TemplateSearch.Common/LocalizableStrings.Designer.cs b/src/Microsoft.TemplateSearch.Common/LocalizableStrings.Designer.cs index 344f76e73f..4852798e9e 100644 --- a/src/Microsoft.TemplateSearch.Common/LocalizableStrings.Designer.cs +++ b/src/Microsoft.TemplateSearch.Common/LocalizableStrings.Designer.cs @@ -70,7 +70,7 @@ internal static string BlobStoreSourceFileProvider_Exception_FailedToUpdateCache } /// - /// Looks up a localized string similar to Local search cache {0} does not exist.. + /// Looks up a localized string similar to Local search cache '{0}' does not exist.. /// internal static string BlobStoreSourceFileProvider_Exception_LocalCacheDoesNotExist { get { diff --git a/src/Microsoft.TemplateSearch.Common/TemplateSearchCache/TemplateSearchCache.Json.cs b/src/Microsoft.TemplateSearch.Common/TemplateSearchCache/TemplateSearchCache.Json.cs index 8404ba7cb6..5fd2ac1abc 100644 --- a/src/Microsoft.TemplateSearch.Common/TemplateSearchCache/TemplateSearchCache.Json.cs +++ b/src/Microsoft.TemplateSearch.Common/TemplateSearchCache/TemplateSearchCache.Json.cs @@ -100,8 +100,6 @@ internal static IDictionary ReadAdditionalData( // This piece of data failed to read, but isn't strictly necessary. } } - - logger.LogDebug($"Successfully read {additionalData.Count} additional information entries."); return additionalData; } diff --git a/test/Microsoft.TemplateEngine.TestTemplates/test_templates/Invalid/InvalidHostData/.template.config/dotnetcli.host.json b/test/Microsoft.TemplateEngine.TestTemplates/test_templates/Invalid/InvalidHostData/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..a293aa4f28 --- /dev/null +++ b/test/Microsoft.TemplateEngine.TestTemplates/test_templates/Invalid/InvalidHostData/.template.config/dotnetcli.host.json @@ -0,0 +1,15 @@ +//bad json +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "SdkVersion": { + "longName": "sdk-version", + "shortName": "" + }, + "RollForward": { + "longName": "roll-forward", + "shortName": "" + }, + "dotnet-cli-version": { + "isHidden": "true" + diff --git a/test/Microsoft.TemplateEngine.TestTemplates/test_templates/Invalid/InvalidHostData/.template.config/template.json b/test/Microsoft.TemplateEngine.TestTemplates/test_templates/Invalid/InvalidHostData/.template.config/template.json new file mode 100644 index 0000000000..21f23c2395 --- /dev/null +++ b/test/Microsoft.TemplateEngine.TestTemplates/test_templates/Invalid/InvalidHostData/.template.config/template.json @@ -0,0 +1,108 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Test Asset", + "classifications": [ + "Config" + ], + "name": "TestAssets.Invalid.InvalidHostData", + "generatorVersions": "[1.0.0.0-*)", + "tags": { + "type": "item" + }, + "groupIdentity": "TestAssets.Invalid.InvalidHostData", + "precedence": "100", + "identity": "TestAssets.Invalid.InvalidHostData", + "shortName": "TestAssets.Invalid.InvalidHostData", + "sourceName": "unused", + "primaryOutputs": [ + { + "path": "global.json" + } + ], + "defaultName": "global.json", + "symbols": { + "HostIdentifier": { + "type": "bind", + "binding": "HostIdentifier" + }, + "SdkVersion": { + "type": "parameter", + "datatype": "string", + "description": "The version of the .NET Core SDK to use.", + "displayName": "SDK version" + }, + "dotnet-cli-version": { + "type": "parameter", + "datatype": "string", + "displayName": "dotnet CLI version" + }, + "CombinedVersion": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "SdkVersion", + "fallbackVariableName": "dotnet-cli-version" + }, + "replaces": "SDK_VERSION" + }, + "RollForward": { + "type": "parameter", + "description": "The roll-forward policy to use when selecting an SDK version.", + "displayName": "Roll Forward", + "replaces": "ROLL_FORWARD_VALUE", + "defaultValue": "", + "datatype": "choice", + "choices": [ + { + "choice": "patch", + "description": "Uses the specified version.\nIf not found, rolls forward to the latest patch level.\nIf not found, fails.\nThis value is the legacy behavior from the earlier versions of the SDK." + }, + { + "choice": "feature", + "description": "Uses the latest patch level for the specified major, minor, and feature band.\nIf not found, rolls forward to the next higher feature band within the same major/minor and uses the latest patch level for that feature band.\nIf not found, fails." + }, + { + "choice": "minor", + "description": "Uses the latest patch level for the specified major, minor, and feature band.\nIf not found, rolls forward to the next higher feature band within the same major/minor version and uses the latest patch level for that feature band.\nIf not found, rolls forward to the next higher minor and feature band within the same major and uses the latest patch level for that feature band.\nIf not found, fails." + }, + { + "choice": "major", + "description": "Uses the latest patch level for the specified major, minor, and feature band.\nIf not found, rolls forward to the next higher feature band within the same major/minor version and uses the latest patch level for that feature band.\nIf not found, rolls forward to the next higher minor and feature band within the same major and uses the latest patch level for that feature band.\nIf not found, rolls forward to the next higher major, minor, and feature band and uses the latest patch level for that feature band.\nIf not found, fails." + }, + { + "choice": "latestPatch", + "description": "Uses the latest installed patch level that matches the requested major, minor, and feature band with a patch level and that is greater or equal than the specified value.\nIf not found, fails." + }, + { + "choice": "latestFeature", + "description": "Uses the highest installed feature band and patch level that matches the requested major and minor with a feature band and patch level that is greater or equal than the specified value.\nIf not found, fails." + }, + { + "choice": "latestMinor", + "description": "Uses the highest installed minor, feature band, and patch level that matches the requested major with a minor, feature band, and patch level that is greater or equal than the specified value.\nIf not found, fails." + }, + { + "choice": "latestMajor", + "description": "Uses the highest installed .NET SDK with a version that is greater or equal than the specified value.\nIf not found, fail." + }, + { + "choice": "disable", + "description": "Doesn't roll forward. Exact match required." + } + ] + } + }, + "postActions": [ + { + "id": "open-file", + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "description": "Opens global.json in the editor", + "manualInstructions": [], + "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", + "args": { + "files": "0" + }, + "continueOnError": true + } + ] +} diff --git a/test/Microsoft.TemplateEngine.TestTemplates/test_templates/Invalid/InvalidHostData/global.json b/test/Microsoft.TemplateEngine.TestTemplates/test_templates/Invalid/InvalidHostData/global.json new file mode 100644 index 0000000000..217558135c --- /dev/null +++ b/test/Microsoft.TemplateEngine.TestTemplates/test_templates/Invalid/InvalidHostData/global.json @@ -0,0 +1,8 @@ +{ + "sdk": { + //#if (RollForward!="") + "rollForward": "ROLL_FORWARD_VALUE", + //#endif + "version": "SDK_VERSION" + } +} \ No newline at end of file diff --git a/test/dotnet-new3.UnitTests/DotnetNewInstall.cs b/test/dotnet-new3.UnitTests/DotnetNewInstall.cs index 3fcdf64704..be3acf4cae 100644 --- a/test/dotnet-new3.UnitTests/DotnetNewInstall.cs +++ b/test/dotnet-new3.UnitTests/DotnetNewInstall.cs @@ -526,5 +526,22 @@ public void CannotInstallTemplateWithoutMandatoryConfig() .And.HaveStdOutContaining($" Source location './' is outside the specified install source location.") .And.HaveStdOutContaining($"No templates were found in the package {invalidTemplatePath}."); } + + [Fact] + public void CanShowWarning_WhenHostDataIsIncorrect() + { + string home = TestUtils.CreateTemporaryFolder("Home"); + string invalidTemplatePath = TestUtils.GetTestTemplateLocation("Invalid/InvalidHostData"); + new DotnetNewCommand(_log, "-i", invalidTemplatePath) + .WithCustomHive(home) + .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) + .Execute() + .Should() + .ExitWith(0) + .And.NotHaveStdErr() + .And.HaveStdOutContaining("Warning: Failed to load host data ") + .And.HaveStdOutContaining($"Success: {invalidTemplatePath} installed the following templates:") + .And.HaveStdOutContaining("TestAssets.Invalid.InvalidHostData"); + } } } diff --git a/test/dotnet-new3.UnitTests/DotnetNewInstantiate.cs b/test/dotnet-new3.UnitTests/DotnetNewInstantiate.cs index 4635f847fe..7dcb247dd3 100644 --- a/test/dotnet-new3.UnitTests/DotnetNewInstantiate.cs +++ b/test/dotnet-new3.UnitTests/DotnetNewInstantiate.cs @@ -460,5 +460,23 @@ public async Task CanInstantiateTemplate_Angular_CanReplaceTextInLargeFile() Assert.Equal(sourceText, targetText); } } + + [Fact] + public void CanShowWarning_WhenHostDataIsIncorrect() + { + string home = TestUtils.CreateTemporaryFolder("Home"); + string workingDirectory = TestUtils.CreateTemporaryFolder(); + Helpers.InstallTestTemplate("Invalid/InvalidHostData", _log, workingDirectory, home); + + new DotnetNewCommand(_log, "TestAssets.Invalid.InvalidHostData") + .WithCustomHive(home) + .WithWorkingDirectory(workingDirectory) + .Execute() + .Should() + .ExitWith(0) + .And.NotHaveStdErr() + .And.HaveStdOutContaining("The template \"TestAssets.Invalid.InvalidHostData\" was created successfully.") + .And.HaveStdOutContaining("Warning: Failed to load dotnet CLI host data "); + } } }