From c0135017ba7d73cfcca932c8a70e7ec6da322da6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Jan 2026 23:54:30 +0000 Subject: [PATCH 1/8] Initial plan From 810cee3728b11ab79568f24ade0bf66323ae510b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 7 Jan 2026 00:10:28 +0000 Subject: [PATCH 2/8] Fix workload manifest handling for missing manifests after SDK upgrade - Update error messages to suggest 'dotnet workload update' instead of 'repair' - Add exception handling in WorkloadInfoHelper and CommandLineInfo for --info commands - Modify SdkDirectoryWorkloadManifestProvider to defer throwing exceptions for missing manifests - This allows workload commands (restore, update, install) to proceed and install missing manifests Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com> --- src/Cli/dotnet/CommandLineInfo.cs | 24 ++++++++++++-- .../dotnet/Commands/CliCommandStrings.resx | 4 +++ .../Commands/Workload/WorkloadInfoHelper.cs | 31 ++++++++++++++++--- .../SdkDirectoryWorkloadManifestProvider.cs | 18 +++++++++-- .../Strings.resx | 8 ++--- 5 files changed, 73 insertions(+), 12 deletions(-) diff --git a/src/Cli/dotnet/CommandLineInfo.cs b/src/Cli/dotnet/CommandLineInfo.cs index b1a4cd319ae5..6e903927efd2 100644 --- a/src/Cli/dotnet/CommandLineInfo.cs +++ b/src/Cli/dotnet/CommandLineInfo.cs @@ -24,7 +24,18 @@ public static void PrintInfo() Reporter.Output.WriteLine($"{LocalizableStrings.DotNetSdkInfoLabel}"); Reporter.Output.WriteLine($" Version: {Product.Version}"); Reporter.Output.WriteLine($" Commit: {commitSha}"); - Reporter.Output.WriteLine($" Workload version: {WorkloadInfoHelper.GetWorkloadsVersion()}"); + + string workloadVersion; + try + { + workloadVersion = WorkloadInfoHelper.GetWorkloadsVersion(); + } + catch (FileNotFoundException) + { + workloadVersion = CliCommandStrings.WorkloadVersionNotInstalledShort; + } + + Reporter.Output.WriteLine($" Workload version: {workloadVersion}"); Reporter.Output.WriteLine($" MSBuild version: {MSBuildForwardingAppWithoutLogging.MSBuildVersion}"); Reporter.Output.WriteLine(); Reporter.Output.WriteLine($"{LocalizableStrings.DotNetRuntimeInfoLabel}"); @@ -40,7 +51,16 @@ private static void PrintWorkloadsInfo() { Reporter.Output.WriteLine(); Reporter.Output.WriteLine($"{LocalizableStrings.DotnetWorkloadInfoLabel}"); - new WorkloadInfoHelper(isInteractive: false).ShowWorkloadsInfo(showVersion: false); + try + { + new WorkloadInfoHelper(isInteractive: false).ShowWorkloadsInfo(showVersion: false); + } + catch (FileNotFoundException ex) + { + // Manifests from workload set are missing - show warning and suggest running update + Reporter.Output.WriteLine(" " + ex.Message); + Reporter.Output.WriteLine(" " + CliCommandStrings.WorkloadsNotInstalledRunWorkloadUpdate); + } } private static string GetDisplayRid(DotnetVersionFile versionFile) diff --git a/src/Cli/dotnet/Commands/CliCommandStrings.resx b/src/Cli/dotnet/Commands/CliCommandStrings.resx index 4753042360fc..54dc3f96eae2 100644 --- a/src/Cli/dotnet/Commands/CliCommandStrings.resx +++ b/src/Cli/dotnet/Commands/CliCommandStrings.resx @@ -2471,6 +2471,10 @@ To display a value, specify the corresponding command-line option without provid Workload version {0}, which was specified in {1}, was not found. Run "dotnet workload restore" to install this workload version. {Locked="dotnet workload restore"} + + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + A workload version to display or one or more workloads and their versions joined by the '@' character. diff --git a/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs b/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs index abcd533aba52..1dc52ba62660 100644 --- a/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs +++ b/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs @@ -114,16 +114,39 @@ internal static string GetWorkloadsVersion(WorkloadInfoHelper? workloadInfoHelpe { workloadInfoHelper ??= new WorkloadInfoHelper(false); - var versionInfo = workloadInfoHelper.ManifestProvider.GetWorkloadVersion(); + try + { + var versionInfo = workloadInfoHelper.ManifestProvider.GetWorkloadVersion(); - // The explicit space here is intentional, as it's easy to miss in localization and crucial for parsing - return versionInfo.Version + (versionInfo.IsInstalled ? string.Empty : ' ' + CliCommandStrings.WorkloadVersionNotInstalledShort); + // The explicit space here is intentional, as it's easy to miss in localization and crucial for parsing + return versionInfo.Version + (versionInfo.IsInstalled ? string.Empty : ' ' + CliCommandStrings.WorkloadVersionNotInstalledShort); + } + catch (FileNotFoundException) + { + // When manifests are missing from a workload set, return a message indicating update is needed + return CliCommandStrings.WorkloadVersionNotInstalledShort; + } } internal void ShowWorkloadsInfo(IReporter? reporter = null, string? dotnetDir = null, bool showVersion = true) { reporter ??= Reporter.Output; - var versionInfo = ManifestProvider.GetWorkloadVersion(); + + WorkloadVersionInfo? versionInfo = null; + bool manifestsNotFound = false; + + try + { + versionInfo = ManifestProvider.GetWorkloadVersion(); + } + catch (FileNotFoundException ex) + { + // Manifests from workload set are missing - show warning and suggest running update + manifestsNotFound = true; + reporter.WriteLine(" " + ex.Message); + reporter.WriteLine(" " + CliCommandStrings.WorkloadsNotInstalledRunWorkloadUpdate); + return; + } void WriteUpdateModeAndAnyError(string indent = "") { diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs index c3da2743abc3..67baa9f3326a 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs @@ -363,7 +363,14 @@ void ProbeDirectory(string manifestDirectory, string featureBand) var manifestDirectory = GetManifestDirectoryFromSpecifier(manifestSpecifier); if (manifestDirectory == null) { - throw new FileNotFoundException(string.Format(Strings.ManifestFromWorkloadSetNotFound, manifestSpecifier.ToString(), _workloadSet.Version)); + // Manifest from workload set is missing. This can happen after SDK upgrades. + // Store the exception to be thrown when needed, but allow workload commands to proceed + // so they can install the missing manifests. + if (_exceptionToThrow == null) + { + _exceptionToThrow = new FileNotFoundException(string.Format(Strings.ManifestFromWorkloadSetNotFound, manifestSpecifier.ToString(), _workloadSet.Version)); + } + continue; } AddManifest(manifestSpecifier.Id.ToString(), manifestDirectory, manifestSpecifier.FeatureBand.ToString(), kvp.Value.Version.ToString()); } @@ -380,7 +387,14 @@ void ProbeDirectory(string manifestDirectory, string featureBand) var manifestDirectory = GetManifestDirectoryFromSpecifier(manifestSpecifier); if (manifestDirectory == null) { - throw new FileNotFoundException(string.Format(Strings.ManifestFromInstallStateNotFound, manifestSpecifier.ToString(), _installStateFilePath)); + // Manifest from install state is missing. This can happen after SDK upgrades. + // Store the exception to be thrown when needed, but allow workload commands to proceed + // so they can install the missing manifests. + if (_exceptionToThrow == null) + { + _exceptionToThrow = new FileNotFoundException(string.Format(Strings.ManifestFromInstallStateNotFound, manifestSpecifier.ToString(), _installStateFilePath)); + } + continue; } AddManifest(manifestSpecifier.Id.ToString(), manifestDirectory, manifestSpecifier.FeatureBand.ToString(), kvp.Value.Version.ToString()); } diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/Strings.resx b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/Strings.resx index cf418daa75cb..f7ab8ac18162 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/Strings.resx +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/Strings.resx @@ -190,12 +190,12 @@ Invalid version: {0} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + {Locked="dotnet workload update"} - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + {Locked="dotnet workload update"} Workload version {0}, which was specified in {1}, was not found. Run "dotnet workload restore" to install this workload version. From 2d0f7e0d568822dbd07033ca40f9dab50a871902 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 7 Jan 2026 00:15:38 +0000 Subject: [PATCH 3/8] Fix compilation errors in CommandLineInfo and WorkloadInfoHelper - Add using statement for Microsoft.DotNet.Cli.Commands in CommandLineInfo - Use full type name IWorkloadManifestProvider.WorkloadVersionInfo in WorkloadInfoHelper - Remove unused variable and fix nullable value checks Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com> --- src/Cli/dotnet/CommandLineInfo.cs | 1 + .../dotnet/Commands/Workload/WorkloadInfoHelper.cs | 12 +++++------- src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf | 5 +++++ src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf | 5 +++++ src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf | 5 +++++ src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf | 5 +++++ src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf | 5 +++++ src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf | 5 +++++ src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf | 5 +++++ src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf | 5 +++++ .../dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf | 5 +++++ src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf | 5 +++++ src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf | 5 +++++ .../Commands/xlf/CliCommandStrings.zh-Hans.xlf | 5 +++++ .../Commands/xlf/CliCommandStrings.zh-Hant.xlf | 5 +++++ .../xlf/Strings.cs.xlf | 12 ++++++------ .../xlf/Strings.de.xlf | 12 ++++++------ .../xlf/Strings.es.xlf | 12 ++++++------ .../xlf/Strings.fr.xlf | 12 ++++++------ .../xlf/Strings.it.xlf | 12 ++++++------ .../xlf/Strings.ja.xlf | 12 ++++++------ .../xlf/Strings.ko.xlf | 12 ++++++------ .../xlf/Strings.pl.xlf | 12 ++++++------ .../xlf/Strings.pt-BR.xlf | 12 ++++++------ .../xlf/Strings.ru.xlf | 12 ++++++------ .../xlf/Strings.tr.xlf | 12 ++++++------ .../xlf/Strings.zh-Hans.xlf | 12 ++++++------ .../xlf/Strings.zh-Hant.xlf | 12 ++++++------ 28 files changed, 149 insertions(+), 85 deletions(-) diff --git a/src/Cli/dotnet/CommandLineInfo.cs b/src/Cli/dotnet/CommandLineInfo.cs index 6e903927efd2..6a21ea1c27e0 100644 --- a/src/Cli/dotnet/CommandLineInfo.cs +++ b/src/Cli/dotnet/CommandLineInfo.cs @@ -3,6 +3,7 @@ #nullable disable +using Microsoft.DotNet.Cli.Commands; using Microsoft.DotNet.Cli.Commands.Workload; using Microsoft.DotNet.Cli.Utils; using LocalizableStrings = Microsoft.DotNet.Cli.Utils.LocalizableStrings; diff --git a/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs b/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs index 1dc52ba62660..d1820878f577 100644 --- a/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs +++ b/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs @@ -132,8 +132,7 @@ internal void ShowWorkloadsInfo(IReporter? reporter = null, string? dotnetDir = { reporter ??= Reporter.Output; - WorkloadVersionInfo? versionInfo = null; - bool manifestsNotFound = false; + IWorkloadManifestProvider.WorkloadVersionInfo? versionInfo = null; try { @@ -142,7 +141,6 @@ internal void ShowWorkloadsInfo(IReporter? reporter = null, string? dotnetDir = catch (FileNotFoundException ex) { // Manifests from workload set are missing - show warning and suggest running update - manifestsNotFound = true; reporter.WriteLine(" " + ex.Message); reporter.WriteLine(" " + CliCommandStrings.WorkloadsNotInstalledRunWorkloadUpdate); return; @@ -156,11 +154,11 @@ void WriteUpdateModeAndAnyError(string indent = "") : CliCommandStrings.WorkloadManifestInstallationConfigurationLooseManifests; reporter.WriteLine(indent + configurationMessage); - if (!versionInfo.IsInstalled) + if (versionInfo.HasValue && !versionInfo.Value.IsInstalled) { - reporter.WriteLine(indent + string.Format(CliCommandStrings.WorkloadSetFromGlobalJsonNotInstalled, versionInfo.Version, versionInfo.GlobalJsonPath)); + reporter.WriteLine(indent + string.Format(CliCommandStrings.WorkloadSetFromGlobalJsonNotInstalled, versionInfo.Value.Version, versionInfo.Value.GlobalJsonPath)); } - else if (versionInfo.WorkloadSetsEnabledWithoutWorkloadSet) + else if (versionInfo.HasValue && versionInfo.Value.WorkloadSetsEnabledWithoutWorkloadSet) { reporter.WriteLine(indent + CliCommandStrings.ShouldInstallAWorkloadSet); } @@ -174,7 +172,7 @@ void WriteUpdateModeAndAnyError(string indent = "") reporter.WriteLine(); } - if (versionInfo.IsInstalled) + if (versionInfo.HasValue && versionInfo.Value.IsInstalled) { var installedList = InstalledSdkWorkloadIds; var installedWorkloads = AddInstalledVsWorkloads(installedList); diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf index 293774c36807..debd62acc817 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf @@ -4065,6 +4065,11 @@ Pokud chcete zobrazit hodnotu, zadejte odpovídající volbu příkazového řá Úlohy + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' Probíhá zápis záznamů o instalaci pro úlohy sady Visual Studio: {0} diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf index bf4889f2658d..cfa17f04c408 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf @@ -4065,6 +4065,11 @@ Um einen Wert anzuzeigen, geben Sie die entsprechende Befehlszeilenoption an, oh Workloads + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' Installationseinträge für Visual Studio Workloads werden geschrieben: „{0}“ diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf index 529999c31c77..087bfcebcdda 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf @@ -4065,6 +4065,11 @@ Para mostrar un valor, especifique la opción de línea de comandos correspondie Cargas de trabajo + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' Escritura de registros de instalación para cargas de trabajo de Visual Studio: '{0}' diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf index d70736f22461..d415f192a2ff 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf @@ -4065,6 +4065,11 @@ Pour afficher une valeur, spécifiez l’option de ligne de commande corresponda Charges de travail + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' Écriture des enregistrements d'installation pour les charges de travail Visual Studio : « {0} » diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf index 3b51ca4b1030..eec9193a9f41 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf @@ -4065,6 +4065,11 @@ Per visualizzare un valore, specifica l'opzione della riga di comando corrispond Carichi di lavoro + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' Scrittura dei record di installazione per carichi di lavoro Visual Studio: '{0}' diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf index c836504745c1..b49e99b59162 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf @@ -4065,6 +4065,11 @@ To display a value, specify the corresponding command-line option without provid ワークロード + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' Visual Studio ワークロードのインストール レコードを書き込み中: '{0}' diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf index c33addce7195..6050fa0d1b6c 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf @@ -4065,6 +4065,11 @@ To display a value, specify the corresponding command-line option without provid 워크로드 + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' Visual Studio 워크로드에 대한 설치 레코드를 쓰는 중: '{0}' diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf index f89492285068..0088f58d195c 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf @@ -4065,6 +4065,11 @@ Aby wyświetlić wartość, należy podać odpowiednią opcję wiersza poleceń Obciążenia + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' Pisanie rekordów instalacji dla obciążeń w usłudze Visual Studio: „{0}” diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf index 81287d03948f..6f91e06e919d 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf @@ -4065,6 +4065,11 @@ Para exibir um valor, especifique a opção de linha de comando correspondente s Cargas de trabalho + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' Gravando registros de instalação para cargas de trabalho do Visual Studio: "{0}" diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf index 52e2408c6370..06e2a1266e56 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf @@ -4066,6 +4066,11 @@ To display a value, specify the corresponding command-line option without provid Рабочие нагрузки + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' Запись сведений об установках для рабочих нагрузок Visual Studio: "{0}" diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf index 0bdf46014f3c..7d224cc7279a 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf @@ -4065,6 +4065,11 @@ Bir değeri görüntülemek için, bir değer sağlamadan ilgili komut satırı İş yükleri + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' Visual Studio iş yükleri için yükleme yazma: '{0}' diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf index 196eb2de4133..aa5e4fcb265d 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf @@ -4065,6 +4065,11 @@ To display a value, specify the corresponding command-line option without provid 工作负载 + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' 写入 Visual Studio 工作负载的安装记录:“{0}” diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf index a11d81925055..773255b411c7 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf @@ -4065,6 +4065,11 @@ To display a value, specify the corresponding command-line option without provid 工作負載 + + Run "dotnet workload update" to install the workloads for this SDK. + Run "dotnet workload update" to install the workloads for this SDK. + {Locked="dotnet workload update"} + Writing install records for Visual Studio workloads: '{0}' 正在寫入 Visual Studio 工作負載的安裝紀錄:'{0}' diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.cs.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.cs.xlf index 1891cc4ff30b..f75e3ad2595a 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.cs.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.cs.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - Manifest úlohy {0}, který byl určen v {1}, nebyl nalezen. Tento problém může vyřešit spuštění „dotnet workload repair“. - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + Manifest úlohy {0}, který byl určen v {1}, nebyl nalezen. Tento problém může vyřešit spuštění „dotnet workload repair“. + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - Manifest úlohy {0} z verze úlohy {1} nebyl nainstalován. Tento problém může vyřešit spuštění „dotnet workload repair“. - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + Manifest úlohy {0} z verze úlohy {1} nebyl nainstalován. Tento problém může vyřešit spuštění „dotnet workload repair“. + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.de.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.de.xlf index aa35c3838c22..866a1ab2b1dc 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.de.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.de.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - Das Arbeitsauslastungsmanifest {0}, das in {1} angegeben wurde, wurde nicht gefunden. Die Ausführung von "dotnet workload repair" kann dies beheben. - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + Das Arbeitsauslastungsmanifest {0}, das in {1} angegeben wurde, wurde nicht gefunden. Die Ausführung von "dotnet workload repair" kann dies beheben. + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - Das Workloadmanifest {0} aus der Workloadversion {1} wurde nicht installiert. Die Ausführung von "dotnet workload repair" kann dies beheben. - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + Das Workloadmanifest {0} aus der Workloadversion {1} wurde nicht installiert. Die Ausführung von "dotnet workload repair" kann dies beheben. + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.es.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.es.xlf index 485e6e0a0cf8..8ea820b5cde2 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.es.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.es.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - No se ha encontrado el manifiesto de carga de trabajo {0}, que se especificó en {1}. La ejecución de "dotnet workload repair" puede resolverlo. - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + No se ha encontrado el manifiesto de carga de trabajo {0}, que se especificó en {1}. La ejecución de "dotnet workload repair" puede resolverlo. + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - No se ha instalado el manifiesto de carga de trabajo {0} de la versión de carga de trabajo {1}. La ejecución de "dotnet workload repair" puede resolverlo. - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + No se ha instalado el manifiesto de carga de trabajo {0} de la versión de carga de trabajo {1}. La ejecución de "dotnet workload repair" puede resolverlo. + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.fr.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.fr.xlf index 0ae7f6800bd3..190315ccd6ec 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.fr.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.fr.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - Le manifeste de charge de travail {0}, spécifié dans {1}, est introuvable. L’exécution "dotnet workload repair" pourrait résoudre ce problème. - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + Le manifeste de charge de travail {0}, spécifié dans {1}, est introuvable. L’exécution "dotnet workload repair" pourrait résoudre ce problème. + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - Le manifeste de charge de travail {0} de la version de charge de travail {1} n’a pas été installé. L’exécution "dotnet workload repair" pourrait résoudre ce problème. - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + Le manifeste de charge de travail {0} de la version de charge de travail {1} n’a pas été installé. L’exécution "dotnet workload repair" pourrait résoudre ce problème. + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.it.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.it.xlf index 7c666799e412..1e9b8e355837 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.it.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.it.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - Il manifesto del carico di lavoro {0}, specificato in {1}, non è stato trovato. L'esecuzione della "dotnet workload repair" può risolvere questo errore. - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + Il manifesto del carico di lavoro {0}, specificato in {1}, non è stato trovato. L'esecuzione della "dotnet workload repair" può risolvere questo errore. + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - Il manifesto del carico di lavoro {0} dalla versione {1} del carico di lavoro non è stato installato. L'esecuzione della "dotnet workload repair" può risolvere questo errore. - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + Il manifesto del carico di lavoro {0} dalla versione {1} del carico di lavoro non è stato installato. L'esecuzione della "dotnet workload repair" può risolvere questo errore. + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ja.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ja.xlf index cc172807eaa9..db170eb1a4ba 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ja.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ja.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - {1} で指定されたワークロード マニフェスト {0} が見つかりませんでした。"dotnet workload repair" を実行すると、これを解決できる場合があります。 - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + {1} で指定されたワークロード マニフェスト {0} が見つかりませんでした。"dotnet workload repair" を実行すると、これを解決できる場合があります。 + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - ワークロード バージョン {1} のワークロード マニフェスト {0} がインストールされませんでした。"dotnet workload repair" を実行すると、これを解決できる場合があります。 - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + ワークロード バージョン {1} のワークロード マニフェスト {0} がインストールされませんでした。"dotnet workload repair" を実行すると、これを解決できる場合があります。 + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ko.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ko.xlf index 385531b1c48b..94bb1f26c36c 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ko.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ko.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - {1}에 지정된 워크로드 매니페스트 {0}을(를) 찾을 수 없습니다. "dotnet workload repair"를 실행하면 이 문제를 해결할 수 있습니다. - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + {1}에 지정된 워크로드 매니페스트 {0}을(를) 찾을 수 없습니다. "dotnet workload repair"를 실행하면 이 문제를 해결할 수 있습니다. + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - 워크로드 버전 {1}의 워크로드 매니페스트 {0}이(가) 설치되지 않았습니다. "dotnet workload repair"를 실행하면 이 문제를 해결할 수 있습니다. - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + 워크로드 버전 {1}의 워크로드 매니페스트 {0}이(가) 설치되지 않았습니다. "dotnet workload repair"를 실행하면 이 문제를 해결할 수 있습니다. + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.pl.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.pl.xlf index 2f5dc549ddf0..731a22718dfa 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.pl.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.pl.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - Nie znaleziono manifestu obciążenia {0}, który został określony w: {1}. Uruchomienie polecenia "dotnet workload repair" może rozwiązać ten problem. - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + Nie znaleziono manifestu obciążenia {0}, który został określony w: {1}. Uruchomienie polecenia "dotnet workload repair" może rozwiązać ten problem. + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - Nie zainstalowano manifestu obciążenia {0} z wersji obciążenia {1}. Uruchomienie polecenia "dotnet workload repair" może rozwiązać ten problem. - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + Nie zainstalowano manifestu obciążenia {0} z wersji obciążenia {1}. Uruchomienie polecenia "dotnet workload repair" może rozwiązać ten problem. + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.pt-BR.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.pt-BR.xlf index f5f0331a25ec..c57811aeaa87 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.pt-BR.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.pt-BR.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - O manifesto {0} de carga de trabalho, que foi especificado em {1}, não foi encontrado. Executar "dotnet workload repair" pode resolver isso. - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + O manifesto {0} de carga de trabalho, que foi especificado em {1}, não foi encontrado. Executar "dotnet workload repair" pode resolver isso. + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - O manifesto de carga {0} da versão de carga de trabalho {1} não foi instalado. Executar "dotnet workload repair" pode resolver isso. - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + O manifesto de carga {0} da versão de carga de trabalho {1} não foi instalado. Executar "dotnet workload repair" pode resolver isso. + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ru.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ru.xlf index bf88a6af7bbe..7c1074737dd1 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ru.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.ru.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - Не найден манифест рабочей нагрузки {0}, указанный в {1}. Выполнение команды "dotnet workload repair" может устранить эту проблему. - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + Не найден манифест рабочей нагрузки {0}, указанный в {1}. Выполнение команды "dotnet workload repair" может устранить эту проблему. + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - Манифест рабочей нагрузки {0} из версии рабочей нагрузки {1} не установлен. Выполнение команды "dotnet workload repair" может устранить эту проблему. - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + Манифест рабочей нагрузки {0} из версии рабочей нагрузки {1} не установлен. Выполнение команды "dotnet workload repair" может устранить эту проблему. + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.tr.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.tr.xlf index 786f001a3435..1eacda8c7195 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.tr.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.tr.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - {1} içinde belirtilen iş yükü bildirimi {0} bulunamadı. Çalışan "dotnet workload repair" bu sorunu çözebilir. - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + {1} içinde belirtilen iş yükü bildirimi {0} bulunamadı. Çalışan "dotnet workload repair" bu sorunu çözebilir. + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - İş yükü sürümünden {1} iş yükü bildirimi {0} yüklenmedi. Çalışan "dotnet workload repair" bu sorunu çözebilir. - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + İş yükü sürümünden {1} iş yükü bildirimi {0} yüklenmedi. Çalışan "dotnet workload repair" bu sorunu çözebilir. + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.zh-Hans.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.zh-Hans.xlf index 911a2731d284..fb8945b7915e 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.zh-Hans.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.zh-Hans.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - 找不到 {1} 中指定的工作负载清单 {0}。运行 "dotnet workload repair" 可能会解决此问题。 - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + 找不到 {1} 中指定的工作负载清单 {0}。运行 "dotnet workload repair" 可能会解决此问题。 + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - 未安装工作负载版本 {0} 中的工作负载清单 {1}。运行 "dotnet workload repair" 可能会解决此问题。 - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + 未安装工作负载版本 {0} 中的工作负载清单 {1}。运行 "dotnet workload repair" 可能会解决此问题。 + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.zh-Hant.xlf b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.zh-Hant.xlf index 423e6216ecca..b5f54d643a33 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.zh-Hant.xlf +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/xlf/Strings.zh-Hant.xlf @@ -83,14 +83,14 @@ - Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload repair" may resolve this. - 找不到 {1} 中指定的工作負載資訊清單 {0}。執行 "dotnet workload repair" 可能會解決這個問題。 - {Locked="dotnet workload repair"} + Workload manifest {0}, which was specified in {1}, was not found. Running "dotnet workload update" may resolve this. + 找不到 {1} 中指定的工作負載資訊清單 {0}。執行 "dotnet workload repair" 可能會解決這個問題。 + {Locked="dotnet workload update"} - Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload repair" may resolve this. - 未安裝工作負載版本 {1} 中的工作負載資訊清單 {0}。執行 "dotnet workload repair" 可能會解決這個問題。 - {Locked="dotnet workload repair"} + Workload manifest {0} from workload version {1} was not installed. Running "dotnet workload update" may resolve this. + 未安裝工作負載版本 {1} 中的工作負載資訊清單 {0}。執行 "dotnet workload repair" 可能會解決這個問題。 + {Locked="dotnet workload update"} Could not find workload '{0}' extended by workload '{1}' in manifest '{2}' [{3}] From 98854d3d39a8f5672da4abfeabaf1cdcf90bd1dd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 7 Jan 2026 00:19:17 +0000 Subject: [PATCH 4/8] Add exception check at end of GetManifests to ensure missing manifests throw - ThrowExceptionIfManifestsNotAvailable() called after processing all manifests - This ensures FileNotFoundException is thrown when manifests are missing - All SdkDirectoryWorkloadManifestProvider tests now pass Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com> --- .../SdkDirectoryWorkloadManifestProvider.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs index 67baa9f3326a..95adaed6241d 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs @@ -414,6 +414,9 @@ void ProbeDirectory(string manifestDirectory, string featureBand) } } + // If we encountered missing manifests from workload sets during enumeration, throw the exception now + ThrowExceptionIfManifestsNotAvailable(); + // Return manifests in a stable order. Manifests in the KnownWorkloadManifests.txt file will be first, and in the same order they appear in that file. // Then the rest of the manifests (if any) will be returned in (ordinal case-insensitive) alphabetical order. return manifestIdsToManifests From 61c2a1851d348eae99f57acd9a69a608edaa2cb4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:18:05 +0000 Subject: [PATCH 5/8] Remove exception throwing from GetManifests and GetWorkloadVersion to unblock workload commands - Removed ThrowExceptionIfManifestsNotAvailable() calls from GetManifests() and GetWorkloadVersion() - GetWorkloadVersion() now returns IsInstalled: false when manifests are missing instead of throwing - GetManifests() returns available manifests even when some from workload set are missing - Updated info commands to check IsInstalled flag instead of catching exceptions - Updated tests to verify new behavior: no exceptions thrown, IsInstalled: false returned - This allows workload install/update/restore commands to proceed and install missing manifests Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com> --- src/Cli/dotnet/CommandLineInfo.cs | 24 +-------- .../Commands/Workload/WorkloadInfoHelper.cs | 44 ++++++---------- .../SdkDirectoryWorkloadManifestProvider.cs | 13 +++-- ...kDirectoryWorkloadManifestProviderTests.cs | 52 ++++++++++++++----- 4 files changed, 63 insertions(+), 70 deletions(-) diff --git a/src/Cli/dotnet/CommandLineInfo.cs b/src/Cli/dotnet/CommandLineInfo.cs index 6a21ea1c27e0..3dcf76e709b2 100644 --- a/src/Cli/dotnet/CommandLineInfo.cs +++ b/src/Cli/dotnet/CommandLineInfo.cs @@ -25,18 +25,7 @@ public static void PrintInfo() Reporter.Output.WriteLine($"{LocalizableStrings.DotNetSdkInfoLabel}"); Reporter.Output.WriteLine($" Version: {Product.Version}"); Reporter.Output.WriteLine($" Commit: {commitSha}"); - - string workloadVersion; - try - { - workloadVersion = WorkloadInfoHelper.GetWorkloadsVersion(); - } - catch (FileNotFoundException) - { - workloadVersion = CliCommandStrings.WorkloadVersionNotInstalledShort; - } - - Reporter.Output.WriteLine($" Workload version: {workloadVersion}"); + Reporter.Output.WriteLine($" Workload version: {WorkloadInfoHelper.GetWorkloadsVersion()}"); Reporter.Output.WriteLine($" MSBuild version: {MSBuildForwardingAppWithoutLogging.MSBuildVersion}"); Reporter.Output.WriteLine(); Reporter.Output.WriteLine($"{LocalizableStrings.DotNetRuntimeInfoLabel}"); @@ -52,16 +41,7 @@ private static void PrintWorkloadsInfo() { Reporter.Output.WriteLine(); Reporter.Output.WriteLine($"{LocalizableStrings.DotnetWorkloadInfoLabel}"); - try - { - new WorkloadInfoHelper(isInteractive: false).ShowWorkloadsInfo(showVersion: false); - } - catch (FileNotFoundException ex) - { - // Manifests from workload set are missing - show warning and suggest running update - Reporter.Output.WriteLine(" " + ex.Message); - Reporter.Output.WriteLine(" " + CliCommandStrings.WorkloadsNotInstalledRunWorkloadUpdate); - } + new WorkloadInfoHelper(isInteractive: false).ShowWorkloadsInfo(showVersion: false); } private static string GetDisplayRid(DotnetVersionFile versionFile) diff --git a/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs b/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs index d1820878f577..c0447846a856 100644 --- a/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs +++ b/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs @@ -114,37 +114,17 @@ internal static string GetWorkloadsVersion(WorkloadInfoHelper? workloadInfoHelpe { workloadInfoHelper ??= new WorkloadInfoHelper(false); - try - { - var versionInfo = workloadInfoHelper.ManifestProvider.GetWorkloadVersion(); + var versionInfo = workloadInfoHelper.ManifestProvider.GetWorkloadVersion(); - // The explicit space here is intentional, as it's easy to miss in localization and crucial for parsing - return versionInfo.Version + (versionInfo.IsInstalled ? string.Empty : ' ' + CliCommandStrings.WorkloadVersionNotInstalledShort); - } - catch (FileNotFoundException) - { - // When manifests are missing from a workload set, return a message indicating update is needed - return CliCommandStrings.WorkloadVersionNotInstalledShort; - } + // The explicit space here is intentional, as it's easy to miss in localization and crucial for parsing + return versionInfo.Version + (versionInfo.IsInstalled ? string.Empty : ' ' + CliCommandStrings.WorkloadVersionNotInstalledShort); } internal void ShowWorkloadsInfo(IReporter? reporter = null, string? dotnetDir = null, bool showVersion = true) { reporter ??= Reporter.Output; - IWorkloadManifestProvider.WorkloadVersionInfo? versionInfo = null; - - try - { - versionInfo = ManifestProvider.GetWorkloadVersion(); - } - catch (FileNotFoundException ex) - { - // Manifests from workload set are missing - show warning and suggest running update - reporter.WriteLine(" " + ex.Message); - reporter.WriteLine(" " + CliCommandStrings.WorkloadsNotInstalledRunWorkloadUpdate); - return; - } + var versionInfo = ManifestProvider.GetWorkloadVersion(); void WriteUpdateModeAndAnyError(string indent = "") { @@ -154,11 +134,19 @@ void WriteUpdateModeAndAnyError(string indent = "") : CliCommandStrings.WorkloadManifestInstallationConfigurationLooseManifests; reporter.WriteLine(indent + configurationMessage); - if (versionInfo.HasValue && !versionInfo.Value.IsInstalled) + if (!versionInfo.IsInstalled) { - reporter.WriteLine(indent + string.Format(CliCommandStrings.WorkloadSetFromGlobalJsonNotInstalled, versionInfo.Value.Version, versionInfo.Value.GlobalJsonPath)); + if (versionInfo.GlobalJsonPath != null) + { + reporter.WriteLine(indent + string.Format(CliCommandStrings.WorkloadSetFromGlobalJsonNotInstalled, versionInfo.Version, versionInfo.GlobalJsonPath)); + } + else + { + // Workload set is installed but manifests are missing + reporter.WriteLine(indent + CliCommandStrings.WorkloadsNotInstalledRunWorkloadUpdate); + } } - else if (versionInfo.HasValue && versionInfo.Value.WorkloadSetsEnabledWithoutWorkloadSet) + else if (versionInfo.WorkloadSetsEnabledWithoutWorkloadSet) { reporter.WriteLine(indent + CliCommandStrings.ShouldInstallAWorkloadSet); } @@ -172,7 +160,7 @@ void WriteUpdateModeAndAnyError(string indent = "") reporter.WriteLine(); } - if (versionInfo.HasValue && versionInfo.Value.IsInstalled) + if (versionInfo.IsInstalled) { var installedList = InstalledSdkWorkloadIds; var installedWorkloads = AddInstalledVsWorkloads(installedList); diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs index 95adaed6241d..11f48289a2ae 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs @@ -260,11 +260,11 @@ public WorkloadVersionInfo GetWorkloadVersion() GlobalJsonSpecifiesWorkloadSets: _globalJsonSpecifiedWorkloadSets); } - ThrowExceptionIfManifestsNotAvailable(); - if (_workloadSet?.Version is not null) { - return new WorkloadVersionInfo(_workloadSet.Version, IsInstalled: true, WorkloadSetsEnabledWithoutWorkloadSet: false, GlobalJsonSpecifiesWorkloadSets: _globalJsonSpecifiedWorkloadSets); + // Return the workload set version, but indicate if manifests are actually installed + // _exceptionToThrow will be set if manifests from the workload set are missing + return new WorkloadVersionInfo(_workloadSet.Version, IsInstalled: _exceptionToThrow == null, WorkloadSetsEnabledWithoutWorkloadSet: false, GlobalJsonSpecifiesWorkloadSets: _globalJsonSpecifiedWorkloadSets); } var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); @@ -290,8 +290,6 @@ public WorkloadVersionInfo GetWorkloadVersion() public IEnumerable GetManifests() { - ThrowExceptionIfManifestsNotAvailable(); - // Scan manifest directories var manifestIdsToManifests = new Dictionary(StringComparer.OrdinalIgnoreCase); @@ -414,8 +412,9 @@ void ProbeDirectory(string manifestDirectory, string featureBand) } } - // If we encountered missing manifests from workload sets during enumeration, throw the exception now - ThrowExceptionIfManifestsNotAvailable(); + // Note: We intentionally do not throw here if manifests from workload sets are missing (_exceptionToThrow != null). + // This allows workload commands (install, update, restore) to proceed and install the missing manifests. + // Info commands will see IsInstalled: false in GetWorkloadVersion() and show appropriate warnings. // Return manifests in a stable order. Manifests in the KnownWorkloadManifests.txt file will be first, and in the same order they appear in that file. // Then the rest of the manifests (if any) will be returned in (ordinal case-insensitive) alphabetical order. diff --git a/test/Microsoft.NET.Sdk.WorkloadManifestReader.Tests/SdkDirectoryWorkloadManifestProviderTests.cs b/test/Microsoft.NET.Sdk.WorkloadManifestReader.Tests/SdkDirectoryWorkloadManifestProviderTests.cs index cbb52e8040c1..feb9dedb4696 100644 --- a/test/Microsoft.NET.Sdk.WorkloadManifestReader.Tests/SdkDirectoryWorkloadManifestProviderTests.cs +++ b/test/Microsoft.NET.Sdk.WorkloadManifestReader.Tests/SdkDirectoryWorkloadManifestProviderTests.cs @@ -420,7 +420,7 @@ var sdkDirectoryWorkloadManifestProvider } [Fact] - public void ItThrowsIfManifestFromWorkloadSetIsNotFound() + public void ItReturnsIsInstalledFalseIfManifestFromWorkloadSetIsNotFound() { Initialize("8.0.200"); @@ -436,7 +436,16 @@ public void ItThrowsIfManifestFromWorkloadSetIsNotFound() var sdkDirectoryWorkloadManifestProvider = new SdkDirectoryWorkloadManifestProvider(sdkRootPath: _fakeDotnetRootDirectory, sdkVersion: "8.0.200", userProfileDir: null, globalJsonPath: null); - Assert.Throws(() => GetManifestContents(sdkDirectoryWorkloadManifestProvider).ToList()); + // GetManifests should not throw, and will scan directories to find available manifests + // Since the workload set specifies ios 12.0.2 which doesn't exist, but 12.0.1 is available on disk, + // it will return 12.0.1 (from directory scan) since workload set manifests override but missing ones don't prevent scanning + var manifests = GetManifestContents(sdkDirectoryWorkloadManifestProvider).ToList(); + manifests.Should().Contain(m => m.Contains("ios: 12.0.1")); + + // GetWorkloadVersion should indicate manifests are not installed (because 12.0.2 is missing) + var versionInfo = sdkDirectoryWorkloadManifestProvider.GetWorkloadVersion(); + versionInfo.Version.Should().Be("8.0.200"); + versionInfo.IsInstalled.Should().BeFalse(); } [Fact] @@ -556,7 +565,7 @@ var sdkDirectoryWorkloadManifestProvider } [Fact] - public void ItFailsIfWorkloadSetFromGlobalJsonIsNotInstalled() + public void ItReturnsIsInstalledFalseIfWorkloadSetFromGlobalJsonIsNotInstalled() { Initialize("8.0.200"); @@ -582,8 +591,15 @@ public void ItFailsIfWorkloadSetFromGlobalJsonIsNotInstalled() """); var manifestProvider = new SdkDirectoryWorkloadManifestProvider(sdkRootPath: _fakeDotnetRootDirectory, sdkVersion: "8.0.200", userProfileDir: null, globalJsonPath: globalJsonPath); - var ex = Assert.Throws(() => manifestProvider.GetManifests()); - ex.Message.Should().Be(string.Format(Strings.WorkloadVersionFromGlobalJsonNotFound, "8.0.201", globalJsonPath)); + + // GetManifests should not throw + var manifests = manifestProvider.GetManifests().ToList(); + + // GetWorkloadVersion should indicate the workload set from global.json is not installed + var versionInfo = manifestProvider.GetWorkloadVersion(); + versionInfo.Version.Should().Be("8.0.201"); + versionInfo.IsInstalled.Should().BeFalse(); + versionInfo.GlobalJsonPath.Should().Be(globalJsonPath); } [Fact] @@ -683,7 +699,7 @@ public void ItFailsIfWorkloadSetFromInstallStateIsNotInstalled() } [Fact] - public void ItFailsIfManifestFromWorkloadSetFromInstallStateIsNotInstalled() + public void ItReturnsIsInstalledFalseIfManifestFromWorkloadSetFromInstallStateIsNotInstalled() { Initialize("8.0.200"); @@ -710,9 +726,17 @@ public void ItFailsIfManifestFromWorkloadSetFromInstallStateIsNotInstalled() var sdkDirectoryWorkloadManifestProvider = new SdkDirectoryWorkloadManifestProvider(sdkRootPath: _fakeDotnetRootDirectory, sdkVersion: "8.0.200", userProfileDir: null, globalJsonPath: null); - var ex = Assert.Throws(() => sdkDirectoryWorkloadManifestProvider.GetManifests().ToList()); - - ex.Message.Should().Be(string.Format(Strings.ManifestFromWorkloadSetNotFound, "ios: 11.0.2/8.0.100", "8.0.201")); + // GetManifests should not throw, and will scan directories to find available manifests + // Since workload set 8.0.201 specifies ios 11.0.2/8.0.100 which doesn't exist, + // but 12.0.1 is available on disk, it will return 12.0.1 from directory scan + var manifests = sdkDirectoryWorkloadManifestProvider.GetManifests().ToList(); + manifests.Should().ContainSingle(); + manifests.Single().ManifestVersion.Should().Be("12.0.1"); + + // GetWorkloadVersion should indicate manifests are not installed (because workload set manifest is missing) + var versionInfo = sdkDirectoryWorkloadManifestProvider.GetWorkloadVersion(); + versionInfo.Version.Should().Be("8.0.201"); + versionInfo.IsInstalled.Should().BeFalse(); } [Fact] @@ -755,7 +779,7 @@ var sdkDirectoryWorkloadManifestProvider } [Fact] - public void ItFailsIfManifestFromInstallStateIsNotInstalled() + public void ItReturnsIsInstalledFalseIfManifestFromInstallStateIsNotInstalled() { Initialize("8.0.200"); @@ -787,9 +811,11 @@ public void ItFailsIfManifestFromInstallStateIsNotInstalled() var sdkDirectoryWorkloadManifestProvider = new SdkDirectoryWorkloadManifestProvider(sdkRootPath: _fakeDotnetRootDirectory, sdkVersion: "8.0.200", userProfileDir: null, globalJsonPath: null); - var ex = Assert.Throws(() => sdkDirectoryWorkloadManifestProvider.GetManifests().ToList()); - - ex.Message.Should().Be(string.Format(Strings.ManifestFromInstallStateNotFound, "ios: 12.0.2/8.0.200", installStatePath)); + // GetManifests should not throw, and will scan directories to find available manifests + // Since ios 12.0.2 doesn't exist, it will scan and find ios 12.0.1 + var manifests = GetManifestContents(sdkDirectoryWorkloadManifestProvider).ToList(); + manifests.Should().ContainSingle(); + manifests.Single().Should().Contain("ios: 12.0.1"); } [Fact] From 9d3bd1e41861f4bc2f17dc612c7dac7812317c0d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 18:11:04 +0000 Subject: [PATCH 6/8] Add GetManifestErrorMessage method to expose errors and show them in info commands and during builds - Added GetManifestErrorMessage() method to SdkDirectoryWorkloadManifestProvider to expose error when manifests are missing - Updated WorkloadInfoHelper.ShowWorkloadsInfo() to display the specific error message when manifests are missing - Updated WorkloadResolver.InitializeManifests() to throw error when trying to use workloads but no manifests are loaded - Error is now shown in 'dotnet workload --info' and when building apps that require workloads - Workload install/update/restore commands still proceed without being blocked Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com> --- .../dotnet/Commands/Workload/WorkloadInfoHelper.cs | 13 +++++++++++++ .../SdkDirectoryWorkloadManifestProvider.cs | 9 +++++++++ .../WorkloadResolver.cs | 14 ++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs b/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs index c0447846a856..81588341edff 100644 --- a/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs +++ b/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs @@ -125,6 +125,13 @@ internal void ShowWorkloadsInfo(IReporter? reporter = null, string? dotnetDir = reporter ??= Reporter.Output; var versionInfo = ManifestProvider.GetWorkloadVersion(); + + // Get the error message if manifests are missing + string? manifestError = null; + if (ManifestProvider is SdkDirectoryWorkloadManifestProvider sdkProvider) + { + manifestError = sdkProvider.GetManifestErrorMessage(); + } void WriteUpdateModeAndAnyError(string indent = "") { @@ -134,6 +141,12 @@ void WriteUpdateModeAndAnyError(string indent = "") : CliCommandStrings.WorkloadManifestInstallationConfigurationLooseManifests; reporter.WriteLine(indent + configurationMessage); + // Show the specific error message if manifests are missing + if (!versionInfo.IsInstalled && manifestError != null) + { + reporter.WriteLine(indent + manifestError); + } + if (!versionInfo.IsInstalled) { if (versionInfo.GlobalJsonPath != null) diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs index 11f48289a2ae..47aec4fb0735 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs @@ -245,6 +245,15 @@ void ThrowExceptionIfManifestsNotAvailable() } } + /// + /// Gets the error message if manifests from a workload set are missing. + /// Returns null if all manifests are available. + /// + public string? GetManifestErrorMessage() + { + return _exceptionToThrow?.Message; + } + public WorkloadVersionInfo GetWorkloadVersion() { if (_globalJsonWorkloadSetVersion != null) diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs index 9cb0dd4d6532..bafe8dc9a3fa 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs @@ -84,6 +84,20 @@ private void InitializeManifests() if (!_initializedManifests) { LoadManifestsFromProvider(_manifestProvider); + + // If manifests from a workload set are missing, check if we got an error + // This will be shown when trying to use workloads but manifests are not available + if (_manifestProvider is SdkDirectoryWorkloadManifestProvider sdkProvider) + { + var manifestError = sdkProvider.GetManifestErrorMessage(); + if (manifestError != null && _manifests.Count == 0) + { + // No manifests were loaded and there's an error - this means workloads won't work + // Throw the error so users know what's wrong + throw new FileNotFoundException(manifestError); + } + } + ComposeWorkloadManifests(); _initializedManifests = true; } From b32666d9de092c5e752ce1cf4ecdf988f050f2cf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 23:53:48 +0000 Subject: [PATCH 7/8] Fix error display by ensuring GetManifests is called before checking error state - ShowWorkloadsInfo now calls GetManifests() before checking error message - This ensures _exceptionToThrow is populated when manifests from workload set are missing - Changed InitializeManifests to always throw if error exists (not just when no manifests loaded) - Fixed redundant error message display logic - Error now properly shown in dotnet --info and dotnet workload --info Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com> --- .../Commands/Workload/WorkloadInfoHelper.cs | 19 +++++++++++++++---- .../WorkloadResolver.cs | 10 +++++----- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs b/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs index 81588341edff..fe7a147fc746 100644 --- a/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs +++ b/src/Cli/dotnet/Commands/Workload/WorkloadInfoHelper.cs @@ -124,14 +124,25 @@ internal void ShowWorkloadsInfo(IReporter? reporter = null, string? dotnetDir = { reporter ??= Reporter.Output; - var versionInfo = ManifestProvider.GetWorkloadVersion(); - // Get the error message if manifests are missing + // We need to call GetManifests() first to ensure _exceptionToThrow is populated + // if manifests from a workload set are missing string? manifestError = null; if (ManifestProvider is SdkDirectoryWorkloadManifestProvider sdkProvider) { + // Calling GetManifests().Count() forces enumeration which populates the error state + try + { + _ = ManifestProvider.GetManifests().Count(); + } + catch + { + // Ignore errors here - we'll get the message via GetManifestErrorMessage + } manifestError = sdkProvider.GetManifestErrorMessage(); } + + var versionInfo = ManifestProvider.GetWorkloadVersion(); void WriteUpdateModeAndAnyError(string indent = "") { @@ -153,9 +164,9 @@ void WriteUpdateModeAndAnyError(string indent = "") { reporter.WriteLine(indent + string.Format(CliCommandStrings.WorkloadSetFromGlobalJsonNotInstalled, versionInfo.Version, versionInfo.GlobalJsonPath)); } - else + else if (manifestError == null) { - // Workload set is installed but manifests are missing + // Workload set is installed but manifests are missing - only show generic message if we don't have a specific error reporter.WriteLine(indent + CliCommandStrings.WorkloadsNotInstalledRunWorkloadUpdate); } } diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs index bafe8dc9a3fa..ec8127be4a94 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs @@ -85,15 +85,15 @@ private void InitializeManifests() { LoadManifestsFromProvider(_manifestProvider); - // If manifests from a workload set are missing, check if we got an error - // This will be shown when trying to use workloads but manifests are not available + // If manifests from a workload set are missing, throw the error when trying to use workloads + // This ensures errors are shown when building apps that require workloads if (_manifestProvider is SdkDirectoryWorkloadManifestProvider sdkProvider) { var manifestError = sdkProvider.GetManifestErrorMessage(); - if (manifestError != null && _manifests.Count == 0) + if (manifestError != null) { - // No manifests were loaded and there's an error - this means workloads won't work - // Throw the error so users know what's wrong + // There's an error with missing manifests from a workload set + // Throw it so users know what's wrong throw new FileNotFoundException(manifestError); } } From a978b87e0dc62c76c8dd50e0e5760accc448542f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 9 Jan 2026 00:29:55 +0000 Subject: [PATCH 8/8] Remove exception throwing from InitializeManifests to allow workload commands to proceed - Reverted throwing behavior in InitializeManifests() - Workload install/update/restore commands can now proceed without being blocked - Error messages still displayed in info commands via ShowWorkloadsInfo() - This allows users to run 'dotnet workload update' to fix missing manifests Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com> --- .../WorkloadResolver.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs index ec8127be4a94..9cb0dd4d6532 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadResolver.cs @@ -84,20 +84,6 @@ private void InitializeManifests() if (!_initializedManifests) { LoadManifestsFromProvider(_manifestProvider); - - // If manifests from a workload set are missing, throw the error when trying to use workloads - // This ensures errors are shown when building apps that require workloads - if (_manifestProvider is SdkDirectoryWorkloadManifestProvider sdkProvider) - { - var manifestError = sdkProvider.GetManifestErrorMessage(); - if (manifestError != null) - { - // There's an error with missing manifests from a workload set - // Throw it so users know what's wrong - throw new FileNotFoundException(manifestError); - } - } - ComposeWorkloadManifests(); _initializedManifests = true; }