diff --git a/src/NuGet.Core/NuGet.Packaging/Signing/TrustStore/FallbackCertificateBundleX509ChainFactory.cs b/src/NuGet.Core/NuGet.Packaging/Signing/TrustStore/FallbackCertificateBundleX509ChainFactory.cs index 83ddc66c690..6645a26a579 100644 --- a/src/NuGet.Core/NuGet.Packaging/Signing/TrustStore/FallbackCertificateBundleX509ChainFactory.cs +++ b/src/NuGet.Core/NuGet.Packaging/Signing/TrustStore/FallbackCertificateBundleX509ChainFactory.cs @@ -59,6 +59,11 @@ internal static bool TryCreate( private static string GetThisAssemblyDirectoryPath() { + if (AppContext.GetData("Microsoft.DotNet.Sdk.Root") is string sdkRoot && sdkRoot.Length > 0) + { + return sdkRoot; + } + return AppContext.BaseDirectory; } }