diff --git a/src/Microsoft.TemplateEngine.Cli/CliConsoleFormatter.cs b/src/Microsoft.TemplateEngine.Cli/CliConsoleFormatter.cs index ed6f8083579..d1fa72f4d52 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 80262f66b8c..6f4e5dd5e9b 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 16f3b276109..85da9351edb 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 6d775a7bef9..45e3f942147 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 2062b9fd502..262c3e94eb9 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 cf60de824f6..1cdf73119b3 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 43eb2a8a0de..98d4f9f9b95 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 89a5342977e..f4b84fdc969 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 fbbca5f31ad..1f103320ca4 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 f207633e08f..5b1352ea0e3 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 12603cae38c..04cc656d049 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 c1d1122c1d7..7cb25733e0c 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 39e2ca2fb44..1329d6074c9 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 e0df8723dfc..241ca6137cc 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 bd24c3f054b..b6543f2b1d5 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 9d69a528f18..90233fef5df 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 6a94ad3eb10..e6962ce4b6e 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 4cf6b343e38..7bfc96d0bec 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 7f2c737ebcc..47b6827b461 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 1dc32737c3c..f0be4eac591 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 dbae887990b..a301457857d 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 2389e71a756..cf7dd538b5e 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 a35771ece7e..585057dee5d 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 1625f7e298b..3aa35310e6e 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 dcdfa911603..8dce5d30b4e 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 a1394c0e09e..02706b310a1 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 2b61c9f6447..75e6bf8dea0 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 3f3024cc6ce..565838f3bc8 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 95383a41f74..075bd3bfb81 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 f13951496a9..d12fa1c0404 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 7eabb39e7d1..92d743f6214 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 344f76e73f9..4852798e9e0 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 8404ba7cb61..5fd2ac1abcd 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 00000000000..a293aa4f284 --- /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 00000000000..21f23c2395b --- /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 00000000000..217558135c9 --- /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 3fcdf647044..be3acf4cae8 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 4635f847fe2..7dcb247dd38 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 "); + } } }