private static bool AreCompatible(TargetFrameworkMetadata projectFramework, IEnumerable <NuGetFramework> packageFrameworks) { var reducer = new FrameworkReducer(); var nearest = reducer.GetNearest(ParseFrameworkName(projectFramework.TargetFrameworkShortName), packageFrameworks); if (nearest == null) { foreach (var import in projectFramework.Imports) { nearest = reducer.GetNearest(ParseFrameworkName(import), packageFrameworks); if (nearest != null) { break; } } } return(nearest != null); }
public static bool AreCompatible(TargetFrameworkMetadata projectFramework, IEnumerable <string> packageFrameworks) { var nugetPackageFrameworks = packageFrameworks.Select(x => ParseFrameworkName(x)); return(AreCompatible(projectFramework, nugetPackageFrameworks)); }