Skip to content

Commit 15db684

Browse files
authored
Replace GetInstalled with result.LockFile.Libraries (#7216)
1 parent 7cc1f0a commit 15db684

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/NuGetSdkResolver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ public static SdkResult GetSdkResult(SdkReference sdk, object nuGetVersion, SdkR
220220
foreach (RestoreResult restoreResult in results.Select(i => i.Result).Where(i => i.Success))
221221
{
222222
// Find the information about the package that was installed. In some cases, the version can be different than what was specified (like you specify 1.0 but get 1.0.0)
223-
var installedPackage = restoreResult.GetAllInstalled().FirstOrDefault(i => i == libraryIdentity);
223+
var installedPackage = restoreResult.LockFile.GetLibrary(libraryIdentity.Name, libraryIdentity.Version);
224224

225225
if (installedPackage != null)
226226
{
227-
if (TryGetMSBuildSdkPackageInfo(fallbackPackagePathResolver, installedPackage, out installedPath, out installedVersion))
227+
if (TryGetMSBuildSdkPackageInfo(fallbackPackagePathResolver, libraryIdentity, out installedPath, out installedVersion))
228228
{
229229
break;
230230
}

0 commit comments

Comments
 (0)