diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs index 79634d19a752..62286d556b8c 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs @@ -151,7 +151,16 @@ public override SdkResult Resolve(SdkReference sdkReference, SdkResolverContext { warnings = new List(); } - warnings.Add(Strings.GlobalJsonResolutionFailed); + + if (!string.IsNullOrWhiteSpace(resolverResult.RequestedVersion)) + { + warnings.Add(string.Format(Strings.GlobalJsonResolutionFailedSpecificVersion, resolverResult.RequestedVersion)); + } + else + { + warnings.Add(Strings.GlobalJsonResolutionFailed); + } + if (propertiesToAdd == null) { propertiesToAdd = new Dictionary(); diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/Strings.resx b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/Strings.resx index b8c6f13924e9..164399e6902d 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/Strings.resx +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/Strings.resx @@ -135,4 +135,7 @@ Unable to locate the .NET SDK as specified by global.json, please check that the specified version is installed. + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.cs.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.cs.xlf index 2a8969e1e9c7..4c3e8de2ff1b 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.cs.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.cs.xlf @@ -7,6 +7,11 @@ Nepovedlo se najít sadu .NET SDK uvedenou v souboru global.json. Zkontrolujte prosím, že je nainstalovaná zadaná verze. + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. {0} nejde najít. Zajistěte, aby byla nainstalovaná dostatečně vysoká verze sady .NET SDK, nebo zvyšte verzi zadanou v souboru global.json. diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.de.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.de.xlf index 92929b1a53fb..aad36f30b6a8 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.de.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.de.xlf @@ -7,6 +7,11 @@ Das in "global.json" angegebene .NET SDK wurde nicht gefunden. Überprüfen Sie, ob die angegebene Version installiert ist. + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. {0} wurde nicht gefunden. Stellen Sie sicher, dass eine aktuelle Version des .NET SDK installiert ist, und/oder erhöhen Sie die in "global.json" angegebene Version. diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.es.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.es.xlf index 3f9236955a93..5227c15237ab 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.es.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.es.xlf @@ -7,6 +7,11 @@ No se encuentra el SDK de .NET tal y como se especifica en global.json; compruebe que la versión especificada esté instalada. + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. No se encuentra {0}. Compruebe que hay un SDK de .NET suficientemente reciente instalado o aumente la versión especificada en global.json. diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.fr.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.fr.xlf index 3df9a5a37c39..5d1e012a80a4 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.fr.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.fr.xlf @@ -7,6 +7,11 @@ Impossible de localiser le kit .NET SDK spécifié par global.json. Vérifiez que la version indiquée est installée. + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. {0} introuvable. Vérifiez qu'un SDK .NET suffisamment récent est installé et/ou augmentez la version spécifiée dans global.json. diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.it.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.it.xlf index e8eb2afc4c0a..2a8f79a908dc 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.it.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.it.xlf @@ -7,6 +7,11 @@ Non è possibile trovare la versione di .NET SDK specificata in global.json. Verificare che sia installata la versione specificata. + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. {0} non è stato trovato. Verificare che sia installata una versione abbastanza recente di .NET SDK e/o aumentare la versione specificata in global.json. diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ja.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ja.xlf index 952d7a913f47..dc05a14faa9a 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ja.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ja.xlf @@ -7,6 +7,11 @@ global.json で指定されている .NET SDK が見つかりません。指定されたバージョンがインストールされていることをご確認ください。 + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. {0} が見つかりません。十分新しい .NET SDK がインストールされていることを確認するか、global.json で指定するバージョンを上げてください (どちらも実行する必要がある場合もあります)。 diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ko.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ko.xlf index 1ee2c6c1066e..6e43bf5fea1c 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ko.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ko.xlf @@ -7,6 +7,11 @@ global.json에 지정된 대로 .NET SDK를 찾을 수 없습니다. 지정한 버전이 설치되어 있는지 확인하세요. + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. {0}을(를) 찾을 수 없습니다. 최신 .NET SDK가 설치되어 있는지 확인하거나 global.json에 지정된 버전을 높이세요. diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.pl.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.pl.xlf index a6d5f11112d7..1ccd1f9c5d7c 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.pl.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.pl.xlf @@ -7,6 +7,11 @@ Nie można zlokalizować zestawu .NET SDK, który został określony przez plik global.json. Upewnij się, że określona wersja jest zainstalowana. + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. Nie można odnaleźć elementu {0}. Sprawdź, czy zainstalowano wystarczająco aktualną wersję zestawu .NET SDK i/lub zwiększ wersję określoną w pliku global.json. diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.pt-BR.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.pt-BR.xlf index 4766c463cbb4..3feba06f4859 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.pt-BR.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.pt-BR.xlf @@ -7,6 +7,11 @@ Não é possível localizar o .NET SDK como especificado pelo global.json. Verifique se a versão especificada está instalada. + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. {0} não encontrado. Verifique se um SDK do .NET suficientemente recente está instalado e/ou aumente a versão especificada em global.json. diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ru.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ru.xlf index 5ab1dc31be00..8692887877c5 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ru.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.ru.xlf @@ -7,6 +7,11 @@ Не удалось найти пакет SDK для .NET, указанный в файле global.json. Убедитесь, что указанная версия установлена. + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. {0} не найден. Убедитесь, что установлена достаточно свежая версия пакета SDK для .NET, и (или) увеличьте версию, указанную в файле global.json. diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.tr.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.tr.xlf index da678979170b..877510525909 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.tr.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.tr.xlf @@ -7,6 +7,11 @@ global.json tarafından belirtilen .NET SDK bulunamıyor, lütfen belirtilen sürümün yüklü olduğundan emin olun. + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. {0} bulunamadı. Yeterince yeni bir .NET SDK'nın yüklü olduğundan emin olun ve/veya global.json içinde belirtilen sürümü artırın. diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.zh-Hans.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.zh-Hans.xlf index 84912902f4d4..1cd3e4467ba8 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.zh-Hans.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.zh-Hans.xlf @@ -7,6 +7,11 @@ 无法找到 global.json 指定的 .NET SDK,请检查是否安装了指定的版本。 + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. 找不到 {0}。请检查是否安装了足够新的 .NET SDK 并/或调高在 global.json 中指定的版本。 diff --git a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.zh-Hant.xlf b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.zh-Hant.xlf index 730013cf04c3..1cf7ce0e8776 100644 --- a/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.zh-Hant.xlf +++ b/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/xlf/Strings.zh-Hant.xlf @@ -7,6 +7,11 @@ 找不到 global.js 所指定的 .NET SDK,請檢查是否已安裝指定的版本。 + + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + Unable to locate the .NET SDK version '{0}' as specified by global.json, please check that the specified version is installed. + + {0} not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json. 找不到 {0}。請檢查安裝的 .NET SDK 是否夠新,以及 (或) 在 global.json 中指定較新的版本。 diff --git a/src/Resolvers/Microsoft.DotNet.NativeWrapper/Interop.cs b/src/Resolvers/Microsoft.DotNet.NativeWrapper/Interop.cs index ac8e191641a9..a407c81d0f5c 100644 --- a/src/Resolvers/Microsoft.DotNet.NativeWrapper/Interop.cs +++ b/src/Resolvers/Microsoft.DotNet.NativeWrapper/Interop.cs @@ -85,6 +85,7 @@ internal enum hostfxr_resolve_sdk2_result_key_t : int { resolved_sdk_dir = 0, global_json_path = 1, + requested_version = 2, } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] diff --git a/src/Resolvers/Microsoft.DotNet.NativeWrapper/SdkResolutionResult.cs b/src/Resolvers/Microsoft.DotNet.NativeWrapper/SdkResolutionResult.cs index 6f6f34cd0ef9..454dca3b7dbc 100644 --- a/src/Resolvers/Microsoft.DotNet.NativeWrapper/SdkResolutionResult.cs +++ b/src/Resolvers/Microsoft.DotNet.NativeWrapper/SdkResolutionResult.cs @@ -17,6 +17,11 @@ public class SdkResolutionResult /// public string GlobalJsonPath; + /// + /// The .NET SDK version specified in global.json. + /// + public string RequestedVersion; + /// /// True if a global.json was found but there was no compatible SDK, so it was ignored. /// @@ -32,6 +37,9 @@ internal void Initialize(Interop.hostfxr_resolve_sdk2_result_key_t key, string v case Interop.hostfxr_resolve_sdk2_result_key_t.global_json_path: GlobalJsonPath = value; break; + case Interop.hostfxr_resolve_sdk2_result_key_t.requested_version: + RequestedVersion = value; + break; } } } diff --git a/src/Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs b/src/Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs index 6676437d246c..fe3c2abf48c6 100644 --- a/src/Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs +++ b/src/Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs @@ -289,7 +289,7 @@ public void ItReturnsHighestSdkAvailableThatIsCompatibleWithMSBuildWhenVersionIn result.PropertiesToAdd.ContainsKey("SdkResolverGlobalJsonPath"); result.PropertiesToAdd["SdkResolverHonoredGlobalJson"].Should().Be("false"); result.Version.Should().Be(disallowPreviews ? "98.98.98" : "99.99.99-preview"); - result.Warnings.Should().BeEquivalentTo(new[] { "Unable to locate the .NET SDK as specified by global.json, please check that the specified version is installed." }); + result.Warnings.Should().BeEquivalentTo(new[] { "Unable to locate the .NET SDK version '1.2.3' as specified by global.json, please check that the specified version is installed." }); result.Errors.Should().BeNullOrEmpty(); } diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildWithGlobalJson.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildWithGlobalJson.cs index fcfb5136a15e..88778cec432a 100644 --- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildWithGlobalJson.cs +++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildWithGlobalJson.cs @@ -45,7 +45,9 @@ public void It_fails_build_on_failed_sdk_resolution(bool runningInVS) var result = buildCommand.Execute($"/p:BuildingInsideVisualStudio={runningInVS}", $"/bl:binlog{runningInVS}.binlog") .Should() .Fail(); - var warningString = "warning : Unable to locate the .NET SDK as specified by global.json, please check that the specified version is installed."; + var warningString = runningInVS + ? "warning : Unable to locate the .NET SDK version '9.9.999' as specified by global.json, please check that the specified version is installed." + : "warning : Unable to locate the .NET SDK as specified by global.json, please check that the specified version is installed."; var errorString = "Unable to locate the .NET SDK. Check that it is installed, your PATH is configured for the correct architecture, and that the version specified in global.json (if any) matches the installed version."; if (runningInVS) {