diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 378eced7b575..86d19fdaad34 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,13 +1,13 @@ - + https://github.com/dotnet/templating - 90b4ea928260c3265949f957d9be506289d8462f + a3f714f94e3bdd206eb64d89771e4fbf30c9640f - + https://github.com/dotnet/templating - 90b4ea928260c3265949f957d9be506289d8462f + a3f714f94e3bdd206eb64d89771e4fbf30c9640f @@ -46,56 +46,56 @@ https://github.com/dotnet/runtime cd2d83798383716204eb580eb5c89ef5b73b8ec2 - + https://github.com/dotnet/msbuild - 82a30d30731031f57ad95519836abc2772ab472a + 3777dcaf7edb3e86a070037ba53e742dd1872873 - + https://github.com/dotnet/msbuild - 82a30d30731031f57ad95519836abc2772ab472a + 3777dcaf7edb3e86a070037ba53e742dd1872873 - + https://github.com/dotnet/fsharp - e707dc8b7a99f0f7c4dd0195709488464b557f77 + ccc97d83ecb8c0ad88585e8cdfaa4bd882b6f9cd - + https://github.com/dotnet/fsharp - e707dc8b7a99f0f7c4dd0195709488464b557f77 + ccc97d83ecb8c0ad88585e8cdfaa4bd882b6f9cd - + https://github.com/dotnet/format - c1136d16ab588f45727fe908212b90578edc2aff + f7beff0efdb20b8f22516d310279204a3fa9ef50 - + https://github.com/dotnet/roslyn - 50b404de631906144f43261fa1abeae8f40b75ef + 785bc38801eac75a5342c3c639fcc5fd5156f263 - + https://github.com/dotnet/roslyn - 50b404de631906144f43261fa1abeae8f40b75ef + 785bc38801eac75a5342c3c639fcc5fd5156f263 - + https://github.com/dotnet/roslyn - 50b404de631906144f43261fa1abeae8f40b75ef + 785bc38801eac75a5342c3c639fcc5fd5156f263 - + https://github.com/dotnet/roslyn - 50b404de631906144f43261fa1abeae8f40b75ef + 785bc38801eac75a5342c3c639fcc5fd5156f263 - + https://github.com/dotnet/roslyn - 50b404de631906144f43261fa1abeae8f40b75ef + 785bc38801eac75a5342c3c639fcc5fd5156f263 - + https://github.com/dotnet/roslyn - 50b404de631906144f43261fa1abeae8f40b75ef + 785bc38801eac75a5342c3c639fcc5fd5156f263 - + https://github.com/dotnet/roslyn - 50b404de631906144f43261fa1abeae8f40b75ef + 785bc38801eac75a5342c3c639fcc5fd5156f263 https://github.com/dotnet/aspnetcore @@ -109,9 +109,9 @@ https://github.com/nuget/nuget.client 125f673fd1cdb3cc012f62aa3ce764d2460b89eb - + https://github.com/microsoft/vstest - bda34b1793ef6ddcd186b7088a6413692efb215e + 86e33e8eb2e9702afc1dcc081b55ed089331aedb https://github.com/dotnet/linker diff --git a/eng/Versions.props b/eng/Versions.props index c1fbe7dfbae3..9534561068e6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -80,7 +80,7 @@ - 17.5.0-preview-20221018-02 + 17.5.0-preview-20221026-01 $(MicrosoftNETTestSdkPackageVersion) $(MicrosoftNETTestSdkPackageVersion) @@ -98,7 +98,7 @@ - 7.0.351204 + 7.0.352902 @@ -106,7 +106,7 @@ - 17.5.0-preview-22519-01 + 17.5.0-preview-22526-01 $(MicrosoftBuildPackageVersion) - 7.0.100-rtm.22507.5 + 7.0.200-alpha.1.22524.8 $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) - 7.0.100-rtm.22507.5 + 7.0.200-alpha.1.22524.8 $(MicrosoftTemplateEngineAbstractionsPackageVersion) - 12.5.0-beta.22519.3 + 12.5.0-beta.22529.1 - 4.5.0-1.22519.12 - 4.5.0-1.22519.12 - 4.5.0-1.22519.12 - 4.5.0-1.22519.12 - 4.5.0-1.22519.12 - 4.5.0-1.22519.12 - 4.5.0-1.22519.12 + 4.5.0-1.22528.14 + 4.5.0-1.22528.14 + 4.5.0-1.22528.14 + 4.5.0-1.22528.14 + 4.5.0-1.22528.14 + 4.5.0-1.22528.14 + 4.5.0-1.22528.14 $(MicrosoftNetCompilersToolsetPackageVersion) @@ -185,7 +185,7 @@ - 6.7.0 + 6.8.0 6.1.0 7.0.0-beta.22511.2 4.8.2 diff --git a/src/Cli/dotnet/commands/dotnet-new/LocalizableStrings.resx b/src/Cli/dotnet/commands/dotnet-new/LocalizableStrings.resx index 7cc284406053..d270021ddf82 100644 --- a/src/Cli/dotnet/commands/dotnet-new/LocalizableStrings.resx +++ b/src/Cli/dotnet/commands/dotnet-new/LocalizableStrings.resx @@ -288,7 +288,7 @@ Run 'dotnet restore {0}' to restore the project. - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -306,5 +306,6 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. + {Locked="dotnet workload search"} \ No newline at end of file diff --git a/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs b/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs index 0a0948d5476e..74ee568e339e 100644 --- a/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs @@ -145,7 +145,10 @@ private static CliTemplateEngineHost CreateHost(bool disableSdkTemplates, bool d builtIns.Add((typeof(ITemplateConstraintFactory), new ProjectCapabilityConstraintFactory())); builtIns.Add((typeof(MSBuildEvaluator), new MSBuildEvaluator(outputDirectory: outputPath?.FullName, projectPath: projectPath?.FullName))); } - builtIns.Add((typeof(IWorkloadsInfoProvider), new WorkloadsInfoProvider(new WorkloadInfoHelper()))); + + builtIns.Add((typeof(IWorkloadsInfoProvider), new WorkloadsInfoProvider( + new Lazy(() => new WorkloadInfoHelper()))) + ); builtIns.Add((typeof(ISdkInfoProvider), new SdkInfoProvider())); string? preferredLangEnvVar = Environment.GetEnvironmentVariable(PrefferedLangEnvVarName); diff --git a/src/Cli/dotnet/commands/dotnet-new/WorkloadsInfoProvider.cs b/src/Cli/dotnet/commands/dotnet-new/WorkloadsInfoProvider.cs index 9fcd02c735ab..2466dcadf077 100644 --- a/src/Cli/dotnet/commands/dotnet-new/WorkloadsInfoProvider.cs +++ b/src/Cli/dotnet/commands/dotnet-new/WorkloadsInfoProvider.cs @@ -16,10 +16,10 @@ namespace Microsoft.DotNet.Tools.New { internal class WorkloadsInfoProvider : IWorkloadsInfoProvider { - private readonly IWorkloadsRepositoryEnumerator _workloadsRepositoryEnumerator; + private readonly Lazy _workloadsRepositoryEnumerator; public Guid Id { get; } = Guid.Parse("{F8BA5B13-7BD6-47C8-838C-66626526817B}"); - public WorkloadsInfoProvider(IWorkloadsRepositoryEnumerator workloadsRepositoryEnumerator) + public WorkloadsInfoProvider(Lazy workloadsRepositoryEnumerator) { _workloadsRepositoryEnumerator = workloadsRepositoryEnumerator; } @@ -27,7 +27,7 @@ public WorkloadsInfoProvider(IWorkloadsRepositoryEnumerator workloadsRepositoryE public Task> GetInstalledWorkloadsAsync(CancellationToken cancellationToken) { return Task.FromResult( - _workloadsRepositoryEnumerator.InstalledAndExtendedWorkloads.Select(w => new WorkloadInfo(w.Id, w.Description)) + _workloadsRepositoryEnumerator.Value.InstalledAndExtendedWorkloads.Select(w => new WorkloadInfo(w.Id, w.Description)) ); } diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.cs.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.cs.xlf index df454d0e3c6f..40b7fd55da05 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.cs.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.cs.xlf @@ -45,8 +45,8 @@ Add project reference to solution action is not configured correctly in the template. The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. - Add project reference to solution action is not configured correctly in the template. - The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. + Akce přidání odkazu na projekt do řešení není v šabloně správně nakonfigurovaná. + SolutionFolder a inRoot se nedají použít společně; použijte jen jednu z těchto možností. do not translate: 'solutionFolder', 'inRoot' @@ -73,9 +73,9 @@ Adding project(s): {0} in the root of solution file: {1} - Adding - project(s): {0} - in the root of solution file: {1} + Přidává se + projekt (nebo projekty): {0} + do kořenového adresáře souboru řešení: {1} {0} - list of file paths to projects to add, {1} - the path to target solution file @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. Spuštěním příkazu dotnet restore {0} projekt obnovíte. - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -275,7 +275,7 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. Spuštěním příkazu dotnet workload search vyhledejte úlohy, které jsou k dispozici pro instalaci ve vaší sadě SDK. - + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.de.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.de.xlf index 4b602e317954..e5bfbaa6bced 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.de.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.de.xlf @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. Führen Sie "dotnet restore {0}" aus, um das Projekt wiederherzustellen. - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -275,7 +275,7 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. Führen Sie „dotnet workload search“ aus, um Workloads zu suchen, die zur Installation in Ihrem SDK verfügbar sind. - + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.es.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.es.xlf index 15967d5221e3..0f44e0e81a8a 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.es.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.es.xlf @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. Ejecute "dotnet restore {0}" para restaurar el proyecto. - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -275,7 +275,7 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. Ejecute "dotnet workload search" para buscar las cargas de trabajo disponibles para instalarse en el SDK. - + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.fr.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.fr.xlf index 7c5881586064..58d6d2f34370 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.fr.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.fr.xlf @@ -45,8 +45,8 @@ Add project reference to solution action is not configured correctly in the template. The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. - Add project reference to solution action is not configured correctly in the template. - The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. + L’ajout d’une référence de projet à l’action de solution n’est pas configuré correctement dans le modèle. + 'solutionFolder' et 'inRoot' ne peuvent pas être utilisés ensemble ; utilisez une seule des options. do not translate: 'solutionFolder', 'inRoot' @@ -73,9 +73,9 @@ Adding project(s): {0} in the root of solution file: {1} - Adding - project(s): {0} - in the root of solution file: {1} + Ajouter + projet(s) : {0} + à la racine du fichier solution : {1} {0} - list of file paths to projects to add, {1} - the path to target solution file @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. Exécutez « dotnet restore {0} » pour restaurer le projet. - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -275,7 +275,7 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. Exécutez 'dotnet workload search' pour rechercher les charges de travail disponibles à installer sur votre SDK. - + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.it.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.it.xlf index 440ebc96000e..77174c9de2d0 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.it.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.it.xlf @@ -45,8 +45,8 @@ Add project reference to solution action is not configured correctly in the template. The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. - Add project reference to solution action is not configured correctly in the template. - The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. + L'azione di aggiunta del riferimento al progetto alla soluzione non è configurata correttamente nel modello. + Non è possibile usare contemporaneamente 'solutionFolder' e 'inRoot'. Usare solo una delle opzioni. do not translate: 'solutionFolder', 'inRoot' @@ -73,9 +73,9 @@ Adding project(s): {0} in the root of solution file: {1} - Adding - project(s): {0} - in the root of solution file: {1} + Aggiunta di + progetti: {0} + nella radice del file di soluzione: {1} {0} - list of file paths to projects to add, {1} - the path to target solution file @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. Eseguire 'dotnet restore {0}' per ripristinare il progetto. - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -275,7 +275,7 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. Eseguire 'dotnet workload search' per cercare i carichi di lavoro disponibili per l'installazione nell'SDK. - + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ja.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ja.xlf index 372072c0be2a..9fc1f12a90f7 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ja.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ja.xlf @@ -45,8 +45,8 @@ Add project reference to solution action is not configured correctly in the template. The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. - Add project reference to solution action is not configured correctly in the template. - The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. + テンプレートでソリューションへのプロジェクト参照の追加アクションが正しく構成されていません。 + 'solutionFolder' と 'inRoot' を同時に使用することはできません。いずれか 1 つのオプションのみを使用してください。 do not translate: 'solutionFolder', 'inRoot' @@ -73,9 +73,9 @@ Adding project(s): {0} in the root of solution file: {1} - Adding - project(s): {0} - in the root of solution file: {1} + + プロジェクトの追加: ソリューション ファイルのルート: {1} に {0} + {0} - list of file paths to projects to add, {1} - the path to target solution file @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. 'dotnet restore {0}' を実行してプロジェクトを復元します。 - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -275,7 +275,7 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. SDK にインストールできるワークロードを検索するには、'dotnet workload search' を実行します。 - + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ko.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ko.xlf index 24b382f1bcd3..795c9d137fb7 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ko.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ko.xlf @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. 프로젝트를 복원하려면 'dotnet restore {0}'을(를) 실행하세요. - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -274,8 +274,8 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. - 'dotnet 워크로드 검색'을 실행하여 SDK에 설치할 수 있는 워크로드를 검색합니다. - + 'dotnet workload search'을 실행하여 SDK에 설치할 수 있는 워크로드를 검색합니다. + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.pl.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.pl.xlf index 6ee810405fcc..e80160a06011 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.pl.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.pl.xlf @@ -45,8 +45,8 @@ Add project reference to solution action is not configured correctly in the template. The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. - Add project reference to solution action is not configured correctly in the template. - The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. + Odwołanie do dodawania projektu do akcji rozwiązania nie jest poprawnie skonfigurowane w szablonie. + Elementów "solutionFolder" i "inRoot" nie można używać razem; użyj tylko jednej z opcji. do not translate: 'solutionFolder', 'inRoot' @@ -73,9 +73,9 @@ Adding project(s): {0} in the root of solution file: {1} - Adding - project(s): {0} - in the root of solution file: {1} + Dodawanie + projektów: {0} + w katalogu głównym pliku rozwiązania: {1} {0} - list of file paths to projects to add, {1} - the path to target solution file @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. Uruchom polecenie „dotnet restore {0}”, aby przywrócić projekt. - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -274,8 +274,8 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. - Uruchom „wyszukiwanie obciążenia dotnet”, aby wyszukać obciążenia dostępne do zainstalowania w twoim zestawie SDK. - + Uruchom 'dotnet workload search', aby wyszukać obciążenia dostępne do zainstalowania w twoim zestawie SDK. + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.pt-BR.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.pt-BR.xlf index 6212c719520b..08b9dca27554 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.pt-BR.xlf @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. Executar o “dotnet restore {0}” para restaurar o projeto. - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -274,8 +274,8 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. - Execute 'pesquisa de carga de trabalho dotnet' para pesquisar cargas de trabalho disponíveis para serem instaladas em seu SDK. - + Execute 'dotnet workload search' para pesquisar cargas de trabalho disponíveis para serem instaladas em seu SDK. + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ru.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ru.xlf index 907e4e33555a..7f3ba7ab36e6 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ru.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.ru.xlf @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. Выполните команду "dotnet restore {0}", чтобы восстановить проект. - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -275,7 +275,7 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. Выполните команду "dotnet workload search", чтобы выполнить поиск среди рабочих нагрузок, доступных для установки в пакете SDK. - + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.tr.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.tr.xlf index 8bf8dd60e86a..77a46d72e315 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.tr.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.tr.xlf @@ -45,8 +45,8 @@ Add project reference to solution action is not configured correctly in the template. The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. - Add project reference to solution action is not configured correctly in the template. - The 'solutionFolder' and 'inRoot' cannot be used together; use only one of the options. + Çözüm eylemine proje başvurusu ekle, şablonda doğru yapılandırılmamış. + 'solutionFolder' ve 'inRoot' birlikte kullanılamaz; seçeneklerden yalnızca birini kullanın. do not translate: 'solutionFolder', 'inRoot' @@ -73,9 +73,9 @@ Adding project(s): {0} in the root of solution file: {1} - Adding - project(s): {0} - in the root of solution file: {1} + + proje(ler) ekleniyor: {0} + çözüm dosyasının kökünde: {1} {0} - list of file paths to projects to add, {1} - the path to target solution file @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. Projeyi geri yüklemek için 'dotnet restore {0}' komutunu çalıştırın. - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -275,7 +275,7 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. SDK'nıza yüklenebilecek iş yüklerini aramak için 'dotnet workload search' komutunu çalıştırın. - + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.zh-Hans.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.zh-Hans.xlf index eb5d7fdc2752..0b2d517460e1 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.zh-Hans.xlf @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. 运行“dotnet restore {0}”以还原项目。 - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -274,8 +274,8 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. - 运行“dotnet 工作负载搜索”以搜索可用于安装在 SDK 上的工作负载。 - + 运行'dotnet workload search' 以搜索可用于安装在 SDK 上的工作负载。 + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.zh-Hant.xlf b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.zh-Hant.xlf index faeb85ba5c82..d68b99acfed2 100644 --- a/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/commands/dotnet-new/xlf/LocalizableStrings.zh-Hant.xlf @@ -250,7 +250,7 @@ Run 'dotnet restore {0}' to restore the project. 執行 'dotnet restore {0}' 以還原專案。 - do not translate 'dotnet restore {0}' + {Locked="dotnet restore {0}"} Project context @@ -274,8 +274,8 @@ Run 'dotnet workload search' to search workloads available to be installed on your SDK. - 執行 ‘dotnet 工作負載搜尋’ 以搜尋可安裝在 SDK 上的工作負載。 - + 執行 'dotnet workload search' 以搜尋可安裝在 SDK 上的工作負載。 + {Locked="dotnet workload search"} diff --git a/src/Cli/dotnet/commands/dotnet-test/Program.cs b/src/Cli/dotnet/commands/dotnet-test/Program.cs index 701e619b035b..b0ca50ee6e91 100644 --- a/src/Cli/dotnet/commands/dotnet-test/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-test/Program.cs @@ -51,7 +51,7 @@ public static int Run(ParseResult parseResult) // Fix for https://github.com/Microsoft/vstest/issues/1453 // Run dll/exe directly using the VSTestForwardingApp - if (ContainsBuiltTestSources(args)) + if (ContainsBuiltTestSources(parseResult)) { return ForwardToVSTestConsole(parseResult, args, settings, testSessionCorrelationId); } @@ -227,16 +227,15 @@ internal static int RunArtifactPostProcessingIfNeeded(string testSessionCorrelat } } - private static bool ContainsBuiltTestSources(string[] args) + private static bool ContainsBuiltTestSources(ParseResult parseResult) { - foreach (string arg in args) + string commandArgument = parseResult.GetValueForArgument(TestCommandParser.SlnOrProjectArgument); + + if (commandArgument is not null && (commandArgument.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) || commandArgument.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))) { - if (!arg.StartsWith("-") && - (arg.EndsWith("dll", StringComparison.OrdinalIgnoreCase) || arg.EndsWith("exe", StringComparison.OrdinalIgnoreCase))) - { - return true; - } + return true; } + return false; } diff --git a/src/Cli/dotnet/commands/dotnet-workload/install/NetSdkMsiInstallerClient.cs b/src/Cli/dotnet/commands/dotnet-workload/install/NetSdkMsiInstallerClient.cs index 368d4716b184..810d7d01791b 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/install/NetSdkMsiInstallerClient.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/install/NetSdkMsiInstallerClient.cs @@ -946,7 +946,7 @@ public static NetSdkMsiInstallerClient Create( string tempDirPath = null, RestoreActionConfig restoreActionConfig = null) { - TimestampedFileLogger logger = new(Path.Combine(Path.GetTempPath(), $"Microsoft.NET.Workload_{DateTime.Now:yyyyMMdd_HHmmss}.log")); + TimestampedFileLogger logger = new(Path.Combine(Path.GetTempPath(), $"Microsoft.NET.Workload_{Environment.ProcessId}_{DateTime.Now:yyyyMMdd_HHmmss}.log")); InstallClientElevationContext elevationContext = new(logger); if (nugetPackageDownloader == null) diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/LocalizableStrings.resx b/src/Cli/dotnet/commands/dotnet-workload/list/LocalizableStrings.resx index b8f2c0826571..b7a929ae43e1 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/LocalizableStrings.resx +++ b/src/Cli/dotnet/commands/dotnet-workload/list/LocalizableStrings.resx @@ -122,8 +122,10 @@ Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. + {Locked="dotnet workload update"} Use `dotnet workload search` to find additional workloads to install. + {Locked="dotnet workload search"} \ No newline at end of file diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.cs.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.cs.xlf index 1df6e1fd7e35..dbc5c5d7eb39 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.cs.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.cs.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. Pokud chcete najít další úlohy, které se mají nainstalovat, použijte `dotnet workload search`. - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. - Aktualizace jsou k dispozici pro následující úlohy: {0}. Pokud chcete získat nejnovější verzi, spusťte aktualizaci úlohy dotnet. - + Aktualizace jsou k dispozici pro následující úlohy: {0}. Pokud chcete získat nejnovější verzi, spusťte aktualizaci úlohy dotnet (`dotnet workload update`). + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.de.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.de.xlf index 178cf16ce8ff..63bfadefbaed 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.de.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.de.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. Verwenden Sie „dotnet workload search“, um zusätzliche zu installierende Workloads zu finden. - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. Updates sind für die folgenden Workloads verfügbar: {0}. Führen Sie „dotnet workload update“ aus, um die neueste Updates zu erhalten. - + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.es.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.es.xlf index c226001cbf9f..6a235d3dceb3 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.es.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.es.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. Use "dotnet workload search" para buscar cargas de trabajo adicionales para instalar. - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. Hay actualizaciones disponibles para las siguientes cargas de trabajo: {0}. Ejecute "dotnet workload update" para obtener la versión más reciente. - + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.fr.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.fr.xlf index 8be28de83d33..7bb2a04f586e 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.fr.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.fr.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. Utilisez `dotnet workload search` pour rechercher d’autres charges de travail à installer. - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. Des mises à jour sont disponibles pour les charges de travail suivantes : {0}. Exécutez `dotnet workload update` pour obtenir la dernière version. - + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.it.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.it.xlf index bd07dcb5c248..1cbcf50e4808 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.it.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.it.xlf @@ -9,13 +9,13 @@ Use `dotnet workload search` to find additional workloads to install. - Utilizzare la 'ricerca del carico di lavoro DotNet' per trovare i carichi di lavoro aggiuntivi da installare. - + Utilizzare la `dotnet workload search` per trovare i carichi di lavoro aggiuntivi da installare. + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. Gli aggiornamenti sono disponibili per i carichi di lavoro seguenti: {0}. Per ottenere la versione più recente, eseguire 'dotnet workload update'. - + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ja.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ja.xlf index 84c6788ed6b4..2b121428078f 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ja.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ja.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. `dotnet workload search` を使用して追加ワークロードを検出し、インストールします。 - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. 次のワークロードについて更新プログラムを入手可能です: {0}。最新版を取得するには、`dotnet workload update` を実行します。 - + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ko.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ko.xlf index f9a84b72752b..bc25fba551b4 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ko.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ko.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. `dotnet workload search`을 사용하여 설치할 추가 워크로드를 찾습니다. - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. 다음 워크로드에 대한 업데이트를 사용할 수 있습니다. {0}. 최신 버전을 받으려면 `dotnet workload update`를 실행하세요. - + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.pl.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.pl.xlf index c3ca428e7dac..d831a98b9807 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.pl.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.pl.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. Użyj polecenia „dotnet workload search”, aby znaleźć dodatkowe obciążenia do zainstalowania. - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. - Aktualizacje są dostępne dla następujących obciążeń: {0}. Uruchom polecenie „aktualizacja obciążenia dotnet”, aby uzyskać najnowszą wersję. - + Aktualizacje są dostępne dla następujących obciążeń: {0}. Uruchom polecenie `dotnet workload update`, aby uzyskać najnowszą wersję. + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.pt-BR.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.pt-BR.xlf index 9c8270bd387d..b9246e9d8a9b 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.pt-BR.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. Use `dotnet workload search` para encontrar cargas de trabalho adicionais a serem instaladas. - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. As atualizações estão disponíveis para as seguintes cargas de trabalho(s): {0}. Execute `dotnet workload update` para obter o mais recente. - + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ru.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ru.xlf index e206591fd74d..7ddcbf47db14 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ru.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.ru.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. Используйте `dotnet workload search`, чтобы найти дополнительные рабочие нагрузки для установки. - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. - Обновления доступны для следующих рабочих нагрузок: {0}. Чтобы получить последнюю версию, запустите обновление рабочей нагрузки DotNet. - + Обновления доступны для следующих рабочих нагрузок: {0}. Чтобы получить последнюю версию, запустите `dotnet workload update`. + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.tr.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.tr.xlf index ad5ad97c8d3c..9ea3ecc06a29 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.tr.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.tr.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. Yüklenecek ek iş yüklerini bulmak için `dotnet workload search` kullanın. - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. Şu iş yükleri için güncelleştirmeler var: {0}. En son sürümü almak için `dotnet workload update` çalıştırın. - + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.zh-Hans.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.zh-Hans.xlf index 030294642bab..ae6dab8c46d0 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.zh-Hans.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. 使用`dotnet workload search`查找要安装的其他工作负载。 - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. 以下工作负载有可用的更新: {0}。请运行 `dotnet workload update` 以获取最新版本。 - + {Locked="dotnet workload update"} diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.zh-Hant.xlf b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.zh-Hant.xlf index 6c13393f4fd5..8365be692fe5 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/commands/dotnet-workload/list/xlf/LocalizableStrings.zh-Hant.xlf @@ -10,12 +10,12 @@ Use `dotnet workload search` to find additional workloads to install. 使用 `dotnet workload search` 尋找其他要安裝的工作負載。 - + {Locked="dotnet workload search"} Updates are available for the following workload(s): {0}. Run `dotnet workload update` to get the latest. 以下工作負載有可用的更新: {0}。執行 `dotnet workload update` 以取得最新更新。 - + {Locked="dotnet workload update"} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets index e6e692882f6d..0b75b2e89fef 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets @@ -166,19 +166,19 @@ Copyright (c) .NET Foundation. All rights reserved. Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(HasRuntimeOutput)' == 'true'"> - - - - diff --git a/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs b/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs index 066c2733742e..16a6ab7ecfa8 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs @@ -6,6 +6,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Xml.Linq; using FluentAssertions; using Microsoft.DotNet.Cli.Utils; using Microsoft.NET.TestFramework; @@ -242,5 +243,27 @@ public void DuplicateRuntimeIdentifiers() .Pass(); } + + [Fact] + public void PublishSuccessfullyWithRIDRequiringPropertyAndRuntimeIdentifiersNoRuntimeIdentifier() + { + var targetFramework = ToolsetInfo.CurrentTargetFramework; + var runtimeIdentifier = EnvironmentInfo.GetCompatibleRid(targetFramework); + var testProject = new TestProject() + { + IsExe = true, + TargetFrameworks = targetFramework + }; + + testProject.AdditionalProperties["RuntimeIdentifiers"] = runtimeIdentifier; + testProject.AdditionalProperties["PublishReadyToRun"] = "true"; + var testAsset = _testAssetsManager.CreateTestProject(testProject); + + var publishCommand = new PublishCommand(testAsset); + publishCommand + .Execute() + .Should() + .Pass(); + } } } diff --git a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/AliasAssignmentTests.cs b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/AliasAssignmentTests.cs index 72175c31f11e..3b7194fe16b2 100644 --- a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/AliasAssignmentTests.cs +++ b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/AliasAssignmentTests.cs @@ -2,7 +2,14 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. // +using System.CommandLine; +using FakeItEasy; +using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Cli.Commands; +using Microsoft.TemplateEngine.Edge; +using Microsoft.TemplateEngine.Edge.Settings; +using Microsoft.TemplateEngine.Mocks; +using Newtonsoft.Json.Linq; namespace Microsoft.TemplateEngine.Cli.UnitTests { @@ -200,5 +207,272 @@ public void CheckAliasAssignmentsMvc20() Assert.Contains("--no-restore", result["skipRestore"].Aliases); Assert.DoesNotContain(result, r => r.Value.Errors.Any()); } + + [Theory] + [InlineData("package", "--param:package")] + [InlineData("u", "-p:u")] + [InlineData("notreserved", "--notreserved")] + public void CanAssignAliasForParameterWithReservedAlias(string parameterName, string expectedContainedAlias) + { + string command = "foo"; + MockTemplateInfo[] templates = new MockTemplateInfo[] + { + new MockTemplateInfo($"{command}", identity: "foo.1", groupIdentity: "foo.group").WithParameters(parameterName) + }; + ICliTemplateEngineHost host = CliTestHostFactory.GetVirtualHost(); + IEngineEnvironmentSettings settings = new EngineEnvironmentSettings(host, virtualizeSettings: true); + TemplatePackageManager templatePackageManager = A.Fake(); + + NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", _ => host); + ParseResult parseResult = myCommand.Parse($" new {command}"); + var args = InstantiateCommandArgs.FromNewCommandArgs(new NewCommandArgs(myCommand, parseResult)); + TemplateGroup templateGroup = TemplateGroup + .FromTemplateList(CliTemplateInfo.FromTemplateInfo(templates, A.Fake())) + .Single(); + var templateCommands = InstantiateCommand.GetTemplateCommand(args, settings, A.Fake(), templateGroup); + Assert.Single(templateCommands); + var templateOption = templateCommands.Single().TemplateOptions[parameterName]; + Assert.Contains(expectedContainedAlias, templateOption.Aliases); + } + + [Theory] +#pragma warning disable CA1825 // Avoid zero-length array allocations. https://github.com/dotnet/sdk/issues/28672 + [MemberData(nameof(GetTemplateData))] +#pragma warning restore CA1825 // Avoid zero-length array allocations. + public void CanOverrideAliasesForParameterWithHostData(string hostJsonData, string expectedJsonResult) + { + var hostData = new HostSpecificTemplateData(string.IsNullOrEmpty(hostJsonData) ? null : JObject.Parse(hostJsonData)); + var expectedResults = JObject.Parse(expectedJsonResult); + var template = new MockTemplateInfo("foo", identity: "foo.1", groupIdentity: "foo.group"); + foreach (var expectedResult in expectedResults) + { + template.WithParameter(expectedResult.Key); + } + var hostDataLoader = A.Fake(); + A.CallTo(() => hostDataLoader.ReadHostSpecificTemplateData(template)).Returns(hostData); + TemplateGroup templateGroup = TemplateGroup.FromTemplateList( + CliTemplateInfo.FromTemplateInfo(new[] { template }, hostDataLoader)) + .Single(); + ICliTemplateEngineHost host = CliTestHostFactory.GetVirtualHost(); + IEngineEnvironmentSettings settings = new EngineEnvironmentSettings(host, virtualizeSettings: true); + TemplatePackageManager templatePackageManager = A.Fake(); + NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", _ => host); + ParseResult parseResult = myCommand.Parse(" new foo"); + InstantiateCommandArgs args = InstantiateCommandArgs.FromNewCommandArgs(new NewCommandArgs(myCommand, parseResult)); + var templateCommands = InstantiateCommand.GetTemplateCommand(args, settings, templatePackageManager, templateGroup); + Assert.Single(templateCommands); + foreach (var expectedResult in expectedResults) + { + var expectedValues = expectedResult.Value!.Select(s => ((JValue)s).Value).ToArray(); + var expectedLongAlias = expectedValues[0]; + var expectedShortAlias = expectedValues[1]; + var expectedIsHidden = expectedValues[2]; + var templateOptions = templateCommands.Single().TemplateOptions; + Assert.NotNull(templateOptions); + Assert.Contains(expectedResult.Key, templateOptions.Keys); + var templateOption = templateOptions[expectedResult.Key]; + Assert.NotNull(templateOption); + Assert.True(templateOption.Aliases.Count > 0); + var longAlias = templateOption.Aliases.ElementAt(0); + var shortAlias = templateOption.Aliases.Count > 1 ? templateOption.Aliases.ElementAt(1) : null; + var isHidden = templateOption.Option.IsHidden; + Assert.Equal(expectedLongAlias, longAlias); + Assert.Equal(expectedShortAlias, shortAlias); + Assert.Equal(expectedIsHidden, isHidden); + } + } + + public static IEnumerable GetTemplateData() + { + // host data and expected option with long alias, short alias and if it is hidden: + // [0] host data + // [1] expected option : 0 - long alias, 1 - short alias, 2 - isHidden + yield return new object[] + { + string.Empty, + @"{ ""Framework"": [""--Framework"", ""-F"", false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""Framework"": { + } + } + }", + @"{ ""Framework"": [""--Framework"", ""-F"", false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""Framework"": { + ""longName"": ""targetframework"" + } + } + }", + @"{ ""Framework"": [""--targetframework"", ""-t"", false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""Framework"": { + ""shortName"": ""fr"" + } + } + }", + @"{ ""Framework"": [""--Framework"", ""-fr"", false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""Framework"": { + ""longName"": ""targetframework"", + ""shortName"": ""fr"" + } + } + }", + @"{ ""Framework"": [""--targetframework"", ""-fr"", false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""Framework"": { + ""longName"": ""targetframework"", + ""shortName"": """" + } + } + }", + @"{ ""Framework"": [""--targetframework"", null, false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""Framework"": { + ""isHidden"": ""true"", + ""longName"": ""targetframework"", + ""shortName"": ""fr"" + } + } + }", + @"{ ""Framework"": [""--targetframework"", ""-fr"", true] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""Framework"": { + ""isHidden"": ""false"", + ""longName"": ""targetframework"", + ""shortName"": ""fr"" + } + } + }", + @"{ ""Framework"": [""--targetframework"", ""-fr"", false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""install"": { + ""longName"": ""set"" + } + } + }", + @"{ ""install"": [""--set"", ""-s"", false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""install"": { + ""longName"": ""setup"", + ""shortName"": ""set"" + } + } + }", + @"{ ""install"": [""--setup"", ""-set"", false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""install"": { + ""longName"": ""set"", + ""shortName"": """" + } + } + }", + @"{ ""install"": [""--set"", null, false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""pack"": { + ""longName"": ""package"" + } + } + }", + @"{ ""pack"": [""--param:package"", ""-p"", false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""add"": { + ""shortName"": ""i"" + } + } + }", + @"{ ""add"": [""--add"", ""-p:i"", false] }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""delete"": { + ""longName"": ""remove"" + } + } + }", + @"{ + ""delete"": [""--remove"", ""-r"", false], + ""remove"": [""--param:remove"", ""-re"", false] + }" + }; + + yield return new object[] + { + @"{ + ""symbolInfo"": { + ""delete"": { + ""longName"": ""remove"" + } + } + }", + @"{ + ""remove"": [""--param:remove"", ""-r"", false], + ""delete"": [""--remove"", ""-re"", false] + }" + }; + } } } diff --git a/src/Tests/dotnet-new.Tests/DotnetNewInstallTests.cs b/src/Tests/dotnet-new.Tests/DotnetNewInstallTests.cs index 634446e0cbe2..d039ee4298b4 100644 --- a/src/Tests/dotnet-new.Tests/DotnetNewInstallTests.cs +++ b/src/Tests/dotnet-new.Tests/DotnetNewInstallTests.cs @@ -563,7 +563,6 @@ public void CannotInstallTemplateWithoutMandatoryConfig() string home = CreateTemporaryFolder(folderName: "Home"); string invalidTemplatePath = GetTestTemplateLocation("Invalid/MissingMandatoryConfig"); new DotnetNewCommand(_log, "-i", invalidTemplatePath) - .WithDebug() .WithCustomHive(home) .WithWorkingDirectory(CreateTemporaryFolder()) .Execute() @@ -571,11 +570,7 @@ public void CannotInstallTemplateWithoutMandatoryConfig() .ExitWith(0) .And.NotHaveStdErr() .And.HaveStdOutContaining($"Error: Failed to load template from {invalidTemplatePath}") - .And.HaveStdOutContaining($" Missing 'identity'.") - .And.HaveStdOutContaining($" Missing 'name'.") - .And.HaveStdOutContaining($" Missing 'shortName'.") - .And.HaveStdOutContaining($" The template root is outside the specified install source location.") - .And.HaveStdOutContaining($" Source location './' is outside the specified install source location.") + .And.HaveStdOutContaining($"Details: The template root is outside the specified install source location.") .And.HaveStdOutContaining($"No templates were found in the package {invalidTemplatePath}."); } diff --git a/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromDll.cs b/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromDll.cs index ed5ffd89efd0..d17ab2294344 100644 --- a/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromDll.cs +++ b/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromDll.cs @@ -113,5 +113,29 @@ public void TestsFromAGivenContainerAndArchSwitchShouldFlowToVsTestConsole() result.ExitCode.Should().Be(1); } + + [Theory] + [InlineData("-e:foo=bardll")] + [InlineData("-e:foo=barexe")] + public void MissingOutputDllAndArgumentsEndWithDllOrExeShouldFailInMSBuild(string arg) + { + var testAppName = "VSTestCore"; + var testAsset = _testAssetsManager.CopyTestAsset(testAppName) + .WithSource() + .WithVersionVariables(); + + new BuildCommand(testAsset) + .Execute() + .Should().Pass(); + + var result = new DotnetTestCommand(Log) + .Execute(arg); + if (!TestContext.IsLocalized()) + { + result.StdOut.Should().Contain("MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file."); + } + + result.ExitCode.Should().Be(1); + } } } diff --git a/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs b/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs index 37991d9aa2e3..a9c6e5a90299 100644 --- a/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs +++ b/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs @@ -801,6 +801,27 @@ public void PathEndsWithSlashOrBackslash(string flag, string slashesOrBackslashe Directory.EnumerateFileSystemEntries(flagDirectory).Should().NotBeEmpty(); } + [Theory] + [InlineData("-e:foo=bardll")] + [InlineData("-e:foo=barexe")] + public void ArgumentsEndWithDllOrExeShouldNotFail(string arg) + { + var testProjectDirectory = CopyAndRestoreVSTestDotNetCoreTestApp(); + + // Call test + CommandResult result = new DotnetTestCommand(Log) + .Execute(testProjectDirectory, arg); + + // Verify + if (!TestContext.IsLocalized()) + { + result.StdOut.Should().Contain("Total: 2"); + result.StdOut.Should().Contain("Passed: 1"); + result.StdOut.Should().Contain("Failed: 1"); + result.StdOut.Should().Contain("Failed VSTestFailTest"); + } + } + private string CopyAndRestoreVSTestDotNetCoreTestApp([CallerMemberName] string callingMethod = "") { // Copy VSTestCore project in output directory of project dotnet-vstest.Tests diff --git a/src/Tests/dotnet.Tests/dotnet-new/DotnetAddPostActionTests.cs b/src/Tests/dotnet.Tests/dotnet-new/DotnetAddPostActionTests.cs index dd8a20048b63..f84c24f4671a 100644 --- a/src/Tests/dotnet.Tests/dotnet-new/DotnetAddPostActionTests.cs +++ b/src/Tests/dotnet.Tests/dotnet-new/DotnetAddPostActionTests.cs @@ -40,7 +40,7 @@ private static string TestCsprojFile [Fact(DisplayName = nameof(AddRefFindsOneDefaultProjFileInOutputDirectory))] public void AddRefFindsOneDefaultProjFileInOutputDirectory() { - string targetBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.proj"); _engineEnvironmentSettings.Host.FileSystem.WriteAllText(projFileFullPath, TestCsprojFile); @@ -54,7 +54,7 @@ public void AddRefFindsOneDefaultProjFileInOutputDirectory() [Fact(DisplayName = nameof(AddRefFindsOneNameConfiguredProjFileInOutputDirectory))] public void AddRefFindsOneNameConfiguredProjFileInOutputDirectory() { - string targetBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string fooprojFileFullPath = Path.Combine(targetBasePath, "MyApp.fooproj"); _engineEnvironmentSettings.Host.FileSystem.WriteAllText(fooprojFileFullPath, TestCsprojFile); @@ -69,7 +69,7 @@ public void AddRefFindsOneNameConfiguredProjFileInOutputDirectory() [Fact(DisplayName = nameof(AddRefFindsOneNameConfiguredProjFileWhenMultipleExtensionsAreAllowed))] public void AddRefFindsOneNameConfiguredProjFileWhenMultipleExtensionsAreAllowed() { - string targetBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string fooprojFileFullPath = Path.Combine(targetBasePath, "MyApp.fooproj"); _engineEnvironmentSettings.Host.FileSystem.WriteAllText(fooprojFileFullPath, TestCsprojFile); @@ -84,7 +84,7 @@ public void AddRefFindsOneNameConfiguredProjFileWhenMultipleExtensionsAreAllowed [Fact(DisplayName = nameof(AddRefIgnoresOtherProjectTypesWhenMultipleTypesAreAllowed))] public void AddRefIgnoresOtherProjectTypesWhenMultipleTypesAreAllowed() { - string targetBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string fooprojFileFullPath = Path.Combine(targetBasePath, "MyApp.fooproj"); _engineEnvironmentSettings.Host.FileSystem.WriteAllText(fooprojFileFullPath, TestCsprojFile); @@ -108,7 +108,7 @@ public void AddRefIgnoresOtherProjectTypesWhenMultipleTypesAreAllowed() [Fact(DisplayName = nameof(AddRefFindsOneDefaultProjFileInAncestorOfOutputDirectory))] public void AddRefFindsOneDefaultProjFileInAncestorOfOutputDirectory() { - string targetBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.xproj"); _engineEnvironmentSettings.Host.FileSystem.WriteAllText(projFileFullPath, TestCsprojFile); @@ -124,7 +124,7 @@ public void AddRefFindsOneDefaultProjFileInAncestorOfOutputDirectory() public void AddRefFindsMultipleDefaultProjFilesInOutputDirectory() { string projFilesOriginalContent = TestCsprojFile; - string targetBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string projFileFullPathOne = Path.Combine(targetBasePath, "MyApp.anysproj"); _engineEnvironmentSettings.Host.FileSystem.WriteAllText(projFileFullPathOne, projFilesOriginalContent); @@ -141,7 +141,7 @@ public void AddRefFindsMultipleDefaultProjFilesInOutputDirectory() public void AddRefFindsMultipleDefaultProjFilesInAncestorOfOutputDirectory() { string projFilesOriginalContent = TestCsprojFile; - string targetBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string projFileFullPathOne = Path.Combine(targetBasePath, "MyApp.fooproj"); _engineEnvironmentSettings.Host.FileSystem.WriteAllText(projFileFullPathOne, projFilesOriginalContent); @@ -161,7 +161,7 @@ public void AddRefCanHandleProjectFileRenames() var callback = new MockAddProjectReferenceCallback(); DotnetAddPostActionProcessor actionProcessor = new(callback.AddPackageReference, callback.AddProjectReference); - string targetBasePath = _engineEnvironmentSettings.GetNewVirtualizedPath(); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); string referencedProjFileFullPath = Path.Combine(targetBasePath, "NewName.csproj"); @@ -189,7 +189,7 @@ public void AddRefCanHandleProjectFilesWithoutRenames() var callback = new MockAddProjectReferenceCallback(); DotnetAddPostActionProcessor actionProcessor = new(callback.AddPackageReference, callback.AddProjectReference); - string targetBasePath = _engineEnvironmentSettings.GetNewVirtualizedPath(); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); string referencedProjFileFullPath = Path.Combine(targetBasePath, "Reference.csproj"); @@ -216,7 +216,7 @@ public void AddRefCanTargetASingleProjectWithAJsonArray() var callback = new MockAddProjectReferenceCallback(); DotnetAddPostActionProcessor actionProcessor = new(callback.AddPackageReference, callback.AddProjectReference); - string targetBasePath = _engineEnvironmentSettings.GetNewVirtualizedPath(); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); var args = new Dictionary() { { "targetFiles", "[\"MyApp.csproj\"]" }, { "referenceType", "package" }, { "reference", "System.Net.Json" } }; @@ -242,7 +242,7 @@ public void AddRefCanTargetASingleProjectWithTheProjectName() var callback = new MockAddProjectReferenceCallback(); DotnetAddPostActionProcessor actionProcessor = new(callback.AddPackageReference, callback.AddProjectReference); - string targetBasePath = _engineEnvironmentSettings.GetNewVirtualizedPath(); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); var args = new Dictionary() { { "targetFiles", "MyApp.csproj" }, { "referenceType", "package" }, { "reference", "System.Net.Json" } }; diff --git a/src/Tests/dotnet.Tests/dotnet-new/DotnetRestorePostActionTests.cs b/src/Tests/dotnet.Tests/dotnet-new/DotnetRestorePostActionTests.cs index cd1ce153e758..5f1aa15855fd 100644 --- a/src/Tests/dotnet.Tests/dotnet-new/DotnetRestorePostActionTests.cs +++ b/src/Tests/dotnet.Tests/dotnet-new/DotnetRestorePostActionTests.cs @@ -28,7 +28,7 @@ public void DotnetRestoreCanTargetASingleProjectWithAJsonArray() var callback = new MockDotnetRestoreCallback(); DotnetRestorePostActionProcessor actionProcessor = new(callback.RestoreProject); - string targetBasePath = _engineEnvironmentSettings.GetNewVirtualizedPath(); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); var args = new Dictionary() { { "files", "[\"MyApp.csproj\"]" } }; @@ -53,7 +53,7 @@ public void DotnetRestoreCanTargetASingleProjectWithTheProjectName() var callback = new MockDotnetRestoreCallback(); DotnetRestorePostActionProcessor actionProcessor = new(callback.RestoreProject); - string targetBasePath = _engineEnvironmentSettings.GetNewVirtualizedPath(); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); var args = new Dictionary() { { "files", "MyApp.csproj" } }; diff --git a/src/Tests/dotnet.Tests/dotnet-new/DotnetSlnPostActionTests.cs b/src/Tests/dotnet.Tests/dotnet-new/DotnetSlnPostActionTests.cs index f7a00a49e81d..fe9517a06f99 100644 --- a/src/Tests/dotnet.Tests/dotnet-new/DotnetSlnPostActionTests.cs +++ b/src/Tests/dotnet.Tests/dotnet-new/DotnetSlnPostActionTests.cs @@ -26,7 +26,7 @@ public DotnetSlnPostActionTests(EnvironmentSettingsHelper environmentSettingsHel [Fact(DisplayName = nameof(AddProjectToSolutionPostActionFindSolutionFileAtOutputPath))] public void AddProjectToSolutionPostActionFindSolutionFileAtOutputPath() { - string targetBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string solutionFileFullPath = Path.Combine(targetBasePath, "MySln.sln"); _engineEnvironmentSettings.Host.FileSystem.WriteAllText(solutionFileFullPath, string.Empty); @@ -38,7 +38,7 @@ public void AddProjectToSolutionPostActionFindSolutionFileAtOutputPath() [Fact(DisplayName = nameof(AddProjectToSolutionPostActionFindsOneProjectToAdd))] public void AddProjectToSolutionPostActionFindsOneProjectToAdd() { - string outputBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string outputBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); IPostAction postAction = new MockPostAction() { ActionId = DotnetSlnPostActionProcessor.ActionProcessorId, @@ -58,7 +58,7 @@ public void AddProjectToSolutionPostActionFindsOneProjectToAdd() [Fact(DisplayName = nameof(AddProjectToSolutionPostActionFindsMultipleProjectsToAdd))] public void AddProjectToSolutionPostActionFindsMultipleProjectsToAdd() { - string outputBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string outputBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); IPostAction postAction = new MockPostAction() { ActionId = DotnetSlnPostActionProcessor.ActionProcessorId, @@ -106,7 +106,7 @@ public void AddProjectToSolutionPostActionDoesntFindProjectOutOfRange() [Fact(DisplayName = nameof(AddProjectToSolutionPostActionFindsMultipleProjectsToAddWithOutputBasePath))] public void AddProjectToSolutionPostActionFindsMultipleProjectsToAddWithOutputBasePath() { - string outputBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string outputBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); IPostAction postAction = new MockPostAction() { @@ -140,7 +140,7 @@ public void AddProjectToSolutionPostActionFindsMultipleProjectsToAddWithOutputBa [Fact(DisplayName = nameof(AddProjectToSolutionPostActionWithoutPrimaryOutputIndexesWithOutputBasePath))] public void AddProjectToSolutionPostActionWithoutPrimaryOutputIndexesWithOutputBasePath() { - string outputBasePath = FileSystemHelpers.GetNewVirtualizedPath(_engineEnvironmentSettings); + string outputBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); IPostAction postAction = new MockPostAction() { @@ -170,7 +170,7 @@ public void AddProjectToSolutionCanTargetASingleProjectWithAJsonArray() var callback = new MockAddProjectToSolutionCallback(); var actionProcessor = new DotnetSlnPostActionProcessor(callback.AddProjectToSolution); - string targetBasePath = _engineEnvironmentSettings.GetNewVirtualizedPath(); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string slnFileFullPath = Path.Combine(targetBasePath, "MyApp.sln"); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); @@ -199,7 +199,7 @@ public void AddProjectToSolutionCanTargetASingleProjectWithTheProjectName() var callback = new MockAddProjectToSolutionCallback(); var actionProcessor = new DotnetSlnPostActionProcessor(callback.AddProjectToSolution); - string targetBasePath = _engineEnvironmentSettings.GetNewVirtualizedPath(); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string slnFileFullPath = Path.Combine(targetBasePath, "MyApp.sln"); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); @@ -228,7 +228,7 @@ public void AddProjectToSolutionCanPlaceProjectInSolutionRoot() var callback = new MockAddProjectToSolutionCallback(); var actionProcessor = new DotnetSlnPostActionProcessor(callback.AddProjectToSolution); - string targetBasePath = _engineEnvironmentSettings.GetNewVirtualizedPath(); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string slnFileFullPath = Path.Combine(targetBasePath, "MyApp.sln"); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); @@ -260,7 +260,7 @@ public void AddProjectToSolutionCanPlaceProjectInSolutionFolder() var callback = new MockAddProjectToSolutionCallback(); var actionProcessor = new DotnetSlnPostActionProcessor(callback.AddProjectToSolution); - string targetBasePath = _engineEnvironmentSettings.GetNewVirtualizedPath(); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string slnFileFullPath = Path.Combine(targetBasePath, "MyApp.sln"); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); @@ -292,7 +292,7 @@ public void AddProjectToSolutionFailsWhenSolutionFolderAndInRootSpecified() var callback = new MockAddProjectToSolutionCallback(); var actionProcessor = new DotnetSlnPostActionProcessor(callback.AddProjectToSolution); - string targetBasePath = _engineEnvironmentSettings.GetNewVirtualizedPath(); + string targetBasePath = _engineEnvironmentSettings.GetTempVirtualizedPath(); string slnFileFullPath = Path.Combine(targetBasePath, "MyApp.sln"); string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); diff --git a/src/Tests/dotnet.Tests/dotnet-new/WorkloadsInfoProviderTests.cs b/src/Tests/dotnet.Tests/dotnet-new/WorkloadsInfoProviderTests.cs index fee37459f3a2..55f21dc9c9bd 100644 --- a/src/Tests/dotnet.Tests/dotnet-new/WorkloadsInfoProviderTests.cs +++ b/src/Tests/dotnet.Tests/dotnet-new/WorkloadsInfoProviderTests.cs @@ -14,6 +14,7 @@ using Xunit; using System.Linq; using System.Collections.Generic; +using System; namespace Microsoft.DotNet.Cli.New.Tests { @@ -44,7 +45,7 @@ public void InstalledWorkloads_ShouldReturnExpectedWorkloads() currentSdkVersion: "1.2.3", workloadRecordRepo: repoMock.Object, workloadResolver: resolverMock.Object); - IWorkloadsInfoProvider wp = new WorkloadsInfoProvider(workloadsEnumerator); + IWorkloadsInfoProvider wp = new WorkloadsInfoProvider(new Lazy(workloadsEnumerator)); // Act var workloads = wp.GetInstalledWorkloadsAsync(default).Result;