Skip to content

Commit

Permalink
Clean up warning logged by package dependency resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinCampbell committed May 17, 2017
1 parent 162c14a commit 1b140cb
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using Microsoft.Extensions.Logging;
using NuGet.ProjectModel;
using OmniSharp.MSBuild.ProjectFile;
Expand Down Expand Up @@ -66,7 +67,13 @@ private ImmutableArray<PackageReference> FindUnresolvedPackageReferencesInLockFi

if (!found)
{
_logger.LogWarning($"{projectFile.Name}: Found '{reference.Dependency.Id}' in lock file, but none of the versions satisfy {reference.Dependency.VersionRange}");
var referenceText = reference.IsImplicitlyDefined
? "implicit package reference"
: "package reference";

var versions = string.Join(", ", libraries.Select(l => '"' + l.Version.ToString() + '"'));

_logger.LogWarning($"{projectFile.Name}: Found {referenceText} '{reference.Dependency.Id}', but none of the versions in the lock file ({versions}) satisfy {reference.Dependency.VersionRange}");
unresolved.Add(reference);
}
}
Expand Down

0 comments on commit 1b140cb

Please sign in to comment.