4 types derived from NuGetFramework
NuGet.Frameworks (3)
AssetTargetFallbackFramework.cs (1)
16public class AssetTargetFallbackFramework : NuGetFramework, IEquatable<AssetTargetFallbackFramework>
DualCompatibilityFramework.cs (1)
14public class DualCompatibilityFramework : NuGetFramework
FallbackFramework.cs (1)
12public class FallbackFramework : NuGetFramework, IEquatable<FallbackFramework>
NuGet.Packaging (1)
ContentModel\AnyFramework.cs (1)
13internal class AnyFramework : NuGetFramework
158 instantiations of NuGetFramework
dotnet (2)
ToolPackage\ToolPackageDownloader.cs (1)
179currentTargetFramework = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(Environment.Version.Major, Environment.Version.Minor));
ToolPackage\ToolPackageInstance.cs (1)
193var currentFramework = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(Environment.Version.Major, Environment.Version.Minor));
Microsoft.DotNet.Build.Tasks.Packaging (3)
Extensions.cs (1)
55result = new NuGetFramework(metadataValue);
PackageIndex.cs (2)
684return new NuGetFramework(parts[0], version, parts[1]); 688return new NuGetFramework(key, version);
Microsoft.NET.Build.Tasks (3)
FrameworkPackages\FrameworkPackages.net9.0.cs (1)
18private static NuGetFramework Net90 { get; } = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(9, 0));
GetPackagesToPrune.cs (2)
219var nugetFramework = new NuGetFramework(targetFrameworkIdentifier, Version.Parse(targetFrameworkVersion)); 243var nugetFramework = new NuGetFramework(targetFrameworkIdentifier, Version.Parse(targetFrameworkVersion));
NuGet.Commands (5)
RestoreCommand\LockFileBuilder.cs (2)
251var nonFallbackFramework = new NuGetFramework(target.TargetFramework); 273new NuGetFramework(target.TargetFramework));
Utility\MSBuildProjectFrameworkUtility.cs (3)
282framework = new NuGetFramework(framework.Framework, framework.Version, framework.Platform, cppCliVersion); 358return new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Windows, 365return new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Windows,
NuGet.Frameworks (143)
DefaultFrameworkMappings.cs (38)
120new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.UAP, FrameworkConstants.EmptyVersion), 125new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Windows, FrameworkConstants.EmptyVersion), 131new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0))), 135new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0)), 136new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WinRT, new Version(4, 5, 0, 0))), 140new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, FrameworkConstants.EmptyVersion), 141new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0))), 145new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WinRT, FrameworkConstants.EmptyVersion), 146new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WinRT, new Version(4, 5, 0, 0))), 151new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, new Version(4, 5, 1, 0))), 155new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WindowsPhone, FrameworkConstants.EmptyVersion), 161new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(3, 0, 0, 0), "WindowsPhone")), 165new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WindowsPhone, new Version(7, 1, 0, 0)), 166new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(4, 0, 0, 0), "WindowsPhone71")), 171new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(8, 0, 0, 0), "WindowsPhone")), 176new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Silverlight, new Version(8, 1, 0, 0), "WindowsPhone")), 180new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WindowsPhoneApp, FrameworkConstants.EmptyVersion), 185new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Tizen, FrameworkConstants.EmptyVersion), 289new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.UAP, FrameworkConstants.EmptyVersion), 290new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.UAP, FrameworkConstants.MaxVersion)), 292new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Windows, FrameworkConstants.EmptyVersion), 293new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Windows, new Version(8, 1, 0, 0)))), 297new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.UAP, FrameworkConstants.EmptyVersion), 298new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.UAP, FrameworkConstants.MaxVersion)), 300new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WindowsPhoneApp, FrameworkConstants.EmptyVersion), 301new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WindowsPhoneApp, new Version(8, 1, 0, 0)))), 305new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.UAP, FrameworkConstants.EmptyVersion), 306new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.UAP, FrameworkConstants.MaxVersion)), 308new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, FrameworkConstants.Version5), 309new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCore, FrameworkConstants.Version5))), 313new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Windows, FrameworkConstants.EmptyVersion), 314new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Windows, FrameworkConstants.MaxVersion)), 316new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WinRT, FrameworkConstants.EmptyVersion), 317new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.WinRT, new Version(4, 5, 0, 0)))), 336new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.UAP, new Version(10, 0, 15064, 0)), 517new NuGetFramework(framework.Framework, FrameworkConstants.MaxVersion)), 530new NuGetFramework(framework.Framework, FrameworkConstants.MaxVersion)), 550var lowestFramework = new NuGetFramework(framework, FrameworkConstants.EmptyVersion);
DefaultPortableFrameworkMappings.cs (6)
110var monoandroid = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.MonoAndroid, new Version(0, 0)); 111var monotouch = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.MonoTouch, new Version(0, 0)); 112var xamarinIOs = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinIOs, new Version(0, 0)); 113var xamarinMac = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinMac, new Version(0, 0)); 114var xamarinTVOS = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinTVOS, new Version(0, 0)); 115var xamarinWatchOS = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinWatchOS, new Version(0, 0));
FrameworkConstants.cs (81)
20new NuGetFramework(FrameworkIdentifiers.NetPlatform, FrameworkConstants.EmptyVersion), 21new NuGetFramework(FrameworkIdentifiers.NetPlatform, FrameworkConstants.MaxVersion)); 80public static readonly NuGetFramework Net11 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(1, 1, 0, 0)); 82public static readonly NuGetFramework Net2 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(2, 0, 0, 0)); 84public static readonly NuGetFramework Net35 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(3, 5, 0, 0)); 86public static readonly NuGetFramework Net4 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 0, 0, 0)); 88public static readonly NuGetFramework Net403 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 0, 3, 0)); 90public static readonly NuGetFramework Net45 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 5, 0, 0)); 92public static readonly NuGetFramework Net451 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 5, 1, 0)); 94public static readonly NuGetFramework Net452 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 5, 2, 0)); 96public static readonly NuGetFramework Net46 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 0, 0)); 98public static readonly NuGetFramework Net461 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 1, 0)); 100public static readonly NuGetFramework Net462 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 2, 0)); 102public static readonly NuGetFramework Net463 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 3, 0)); 104public static readonly NuGetFramework Net47 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 7, 0, 0)); 106public static readonly NuGetFramework Net471 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 7, 1, 0)); 108public static readonly NuGetFramework Net472 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 7, 2, 0)); 110public static readonly NuGetFramework Net48 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 8, 0, 0)); 112public static readonly NuGetFramework Net481 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 8, 1, 0)); 116public static readonly NuGetFramework NetCore45 = new NuGetFramework(FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0)); 119public static readonly NuGetFramework NetCore451 = new NuGetFramework(FrameworkIdentifiers.NetCore, new Version(4, 5, 1, 0)); 122public static readonly NuGetFramework NetCore50 = new NuGetFramework(FrameworkIdentifiers.NetCore, new Version(5, 0, 0, 0)); 124public static readonly NuGetFramework Win8 = new NuGetFramework(FrameworkIdentifiers.Windows, new Version(8, 0, 0, 0)); 125public static readonly NuGetFramework Win81 = new NuGetFramework(FrameworkIdentifiers.Windows, new Version(8, 1, 0, 0)); 126public static readonly NuGetFramework Win10 = new NuGetFramework(FrameworkIdentifiers.Windows, new Version(10, 0, 0, 0)); 128public static readonly NuGetFramework SL4 = new NuGetFramework(FrameworkIdentifiers.Silverlight, new Version(4, 0, 0, 0)); 129public static readonly NuGetFramework SL5 = new NuGetFramework(FrameworkIdentifiers.Silverlight, new Version(5, 0, 0, 0)); 131public static readonly NuGetFramework WP7 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(7, 0, 0, 0)); 132public static readonly NuGetFramework WP75 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(7, 5, 0, 0)); 133public static readonly NuGetFramework WP8 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(8, 0, 0, 0)); 134public static readonly NuGetFramework WP81 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(8, 1, 0, 0)); 135public static readonly NuGetFramework WPA81 = new NuGetFramework(FrameworkIdentifiers.WindowsPhoneApp, new Version(8, 1, 0, 0)); 137public static readonly NuGetFramework Tizen3 = new NuGetFramework(FrameworkIdentifiers.Tizen, new Version(3, 0, 0, 0)); 138public static readonly NuGetFramework Tizen4 = new NuGetFramework(FrameworkIdentifiers.Tizen, new Version(4, 0, 0, 0)); 139public static readonly NuGetFramework Tizen6 = new NuGetFramework(FrameworkIdentifiers.Tizen, new Version(6, 0, 0, 0)); 141public static readonly NuGetFramework AspNet = new NuGetFramework(FrameworkIdentifiers.AspNet, EmptyVersion); 142public static readonly NuGetFramework AspNetCore = new NuGetFramework(FrameworkIdentifiers.AspNetCore, EmptyVersion); 143public static readonly NuGetFramework AspNet50 = new NuGetFramework(FrameworkIdentifiers.AspNet, Version5); 144public static readonly NuGetFramework AspNetCore50 = new NuGetFramework(FrameworkIdentifiers.AspNetCore, Version5); 146public static readonly NuGetFramework Dnx = new NuGetFramework(FrameworkIdentifiers.Dnx, EmptyVersion); 147public static readonly NuGetFramework Dnx45 = new NuGetFramework(FrameworkIdentifiers.Dnx, new Version(4, 5, 0, 0)); 148public static readonly NuGetFramework Dnx451 = new NuGetFramework(FrameworkIdentifiers.Dnx, new Version(4, 5, 1, 0)); 149public static readonly NuGetFramework Dnx452 = new NuGetFramework(FrameworkIdentifiers.Dnx, new Version(4, 5, 2, 0)); 150public static readonly NuGetFramework DnxCore = new NuGetFramework(FrameworkIdentifiers.DnxCore, EmptyVersion); 151public static readonly NuGetFramework DnxCore50 = new NuGetFramework(FrameworkIdentifiers.DnxCore, Version5); 154= new NuGetFramework(FrameworkIdentifiers.NetPlatform, EmptyVersion); 156= new NuGetFramework(FrameworkIdentifiers.NetPlatform, Version5); 158= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 1, 0, 0)); 160= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 2, 0, 0)); 162= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 3, 0, 0)); 164= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 4, 0, 0)); 166= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 5, 0, 0)); 168= new NuGetFramework(FrameworkIdentifiers.NetPlatform, new Version(5, 6, 0, 0)); 171= new NuGetFramework(FrameworkIdentifiers.NetStandard, EmptyVersion); 174= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 0, 0, 0)); 177= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 1, 0, 0)); 180= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 2, 0, 0)); 183= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 3, 0, 0)); 186= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 4, 0, 0)); 189= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 5, 0, 0)); 192= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 6, 0, 0)); 195= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(1, 7, 0, 0)); 198= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(2, 0, 0, 0)); 201= new NuGetFramework(FrameworkIdentifiers.NetStandard, new Version(2, 1, 0, 0)); 204= new NuGetFramework(FrameworkIdentifiers.NetStandardApp, new Version(1, 5, 0, 0)); 207= new NuGetFramework(FrameworkIdentifiers.UAP, Version10); 211= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(1, 0, 0, 0)); 214= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(1, 1, 0, 0)); 217= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(2, 0, 0, 0)); 220= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(2, 1, 0, 0)); 223= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(2, 2, 0, 0)); 226= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(3, 0, 0, 0)); 229= new NuGetFramework(FrameworkIdentifiers.NetCoreApp, new Version(3, 1, 0, 0)); 233public static readonly NuGetFramework Net50 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version5); 235public static readonly NuGetFramework Net60 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version6); 237public static readonly NuGetFramework Net70 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7); 239public static readonly NuGetFramework Net80 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version8); 241public static readonly NuGetFramework Net90 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version9); 243public static readonly NuGetFramework Net10_0 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version10); 245public static readonly NuGetFramework Net11_0 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version11); 247public static readonly NuGetFramework Native = new NuGetFramework(FrameworkIdentifiers.Native, new Version(0, 0, 0, 0));
FrameworkExpander.cs (2)
89new NuGetFramework(framework.Framework, new Version(0, 0), framework.Profile), 108yield return new NuGetFramework(subFramework, framework.Version, framework.Profile);
FrameworkNameProvider.cs (4)
593result.Add(new NuGetFramework(fw.Framework, fw.Version, eqProfile)); 1123var portable = new NuGetFramework( 1153set.Add(new NuGetFramework(subFramework, framework.Version, framework.Profile)); 1161set.Add(new NuGetFramework(superFramework, framework.Version, framework.Profile));
NuGetFrameworkFactory.cs (12)
18public static readonly NuGetFramework UnsupportedFramework = new NuGetFramework(FrameworkConstants.SpecialIdentifiers.Unsupported); 23public static readonly NuGetFramework AgnosticFramework = new NuGetFramework(FrameworkConstants.SpecialIdentifiers.Agnostic); 28public static readonly NuGetFramework AnyFramework = new NuGetFramework(FrameworkConstants.SpecialIdentifiers.Any); 129result = new NuGetFramework(targetFrameworkIdentifier, targetFrameworkVersion, targetPlatformIdentifier ?? string.Empty, platformVersion); 133result = new NuGetFramework(targetFrameworkIdentifier, targetFrameworkVersion, profile); 164result = new NuGetFramework(framework, version, string.Empty, FrameworkConstants.EmptyVersion); 168result = new NuGetFramework(framework, version, profile); 317result = new NuGetFramework(framework, version, platform ?? string.Empty, platformVersion ?? FrameworkConstants.EmptyVersion); 326result = new NuGetFramework(framework, version, string.Empty, FrameworkConstants.EmptyVersion); 348result = new NuGetFramework(framework, version, portableProfileNumber); 352result = new NuGetFramework(framework, version, profileShort); 358result = new NuGetFramework(framework, version, profile);
NuGet.Packaging (2)
ContentModel\ManagedCodeConventions.cs (2)
41{ "tfm", new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Net, FrameworkConstants.EmptyVersion) }, 262return new NuGetFramework(name, FrameworkConstants.EmptyVersion);
1569 references to NuGetFramework
aspire-managed (3)
NuGet\Commands\RestoreCommand.cs (3)
155var nugetFramework = NuGetFramework.Parse(framework); 333NuGetFramework framework,
Crossgen2Tasks (2)
CommonFilePulledFromSdkRepo\NuGetUtils.NuGet.cs (2)
38public static NuGetFramework? ParseFrameworkName(string? frameworkName) 40return frameworkName == null ? null : NuGetFramework.Parse(frameworkName);
dotnet (64)
BundledTargetFramework.cs (1)
21return NuGetFramework
CommandFactory\CommandFactory.cs (1)
16NuGetFramework framework = null,
CommandFactory\CommandFactoryUsingResolver.cs (3)
20NuGetFramework framework = null, 40NuGetFramework framework = null, 61NuGetFramework framework = null,
CommandFactory\CommandResolution\CommandResolverArguments.cs (1)
16public NuGetFramework Framework { get; set; }
CommandFactory\CommandResolution\IProject.cs (1)
27NuGetFramework DotnetCliToolTargetFramework { get; }
CommandFactory\CommandResolution\LocalToolsCommandResolver.cs (1)
81NuGetFramework.Parse(BundledTargetFramework.GetTargetFrameworkMoniker()),
CommandFactory\CommandResolution\MSBuildProject.cs (4)
16private static readonly NuGetFramework s_toolPackageFramework = FrameworkConstants.CommonFrameworks.NetCoreApp10; 56public NuGetFramework DotnetCliToolTargetFramework 70return NuGetFramework.Parse(frameworkString); 101NuGetFramework framework,
CommandFactory\CommandResolution\ProjectDependenciesCommandResolver.cs (2)
69NuGetFramework framework, 135LockFile lockFile, string commandName, NuGetFramework targetFramework)
CommandFactory\CommandResolution\ProjectFactory.cs (2)
21NuGetFramework framework, 29private IProject GetMSBuildProj(string projectDirectory, NuGetFramework framework, string configuration, string outputPath)
CommandFactory\CommandResolution\ProjectToolsCommandResolver.cs (11)
119List<NuGetFramework> toolFrameworksToCheck = [project.DotnetCliToolTargetFramework]; 126toolFrameworksToCheck.Add(NuGetFramework.Parse("netcoreapp1.1")); 127toolFrameworksToCheck.Add(NuGetFramework.Parse("netcoreapp1.0")); 131NuGetFramework? toolTargetFramework = null; 133foreach (var toolFramework in toolFrameworksToCheck) 216NuGetFramework framework, 241NuGetFramework framework, 269NuGetFramework framework, 282NuGetFramework framework, 303NuGetFramework framework, 316NuGetFramework framework,
CommandFactory\CommandResolution\ToolPathCalculator.cs (2)
16public string GetBestLockFilePath(string packageId, VersionRange versionRange, NuGetFramework framework) 41public string GetLockFilePath(string packageId, NuGetVersion version, NuGetFramework framework)
CommandFactory\CommandResolver.cs (2)
17NuGetFramework framework = null, 36NuGetFramework framework = null,
CommandFactory\ICommandFactory.cs (1)
16NuGetFramework framework = null,
Commands\DotNetCommandFactory.cs (1)
23public ICommand Create(string commandName, IEnumerable<string> args, NuGetFramework? framework = null, string configuration = Constants.DefaultConfiguration)
Commands\Reference\Add\ReferenceAddCommand.cs (3)
41foreach (var tfm in msbuildProj.GetTargetFrameworks()) 57var framework = NuGetFramework.Parse(frameworkString);
Commands\Tool\Install\LocalToolsResolverCacheExtensions.cs (1)
41NuGetFramework.Parse(targetFrameworkToInstall),
Commands\Tool\Install\ToolInstallGlobalOrToolPathCommand.cs (2)
238NuGetFramework? framework; 247framework = string.IsNullOrEmpty(_framework) ? null : NuGetFramework.Parse(_framework);
Commands\Tool\Restore\ToolPackageRestorer.cs (2)
94NuGetFramework.Parse(targetFramework), 126NuGetFramework.Parse(targetFramework),
Extensions\ProjectExtensions.cs (2)
22public static IEnumerable<NuGetFramework> GetTargetFrameworks(this Project project) 32.Select((frameworkString) => NuGetFramework.Parse(frameworkString));
MsbuildProject.cs (6)
28private List<NuGetFramework> _cachedTfms = null; 138public IEnumerable<NuGetFramework> GetTargetFrameworks() 155public bool CanWorkOnFramework(NuGetFramework framework) 157foreach (var tfm in GetTargetFrameworks()) 168public bool IsTargetingFramework(NuGetFramework framework) 170foreach (var tfm in GetTargetFrameworks())
ShellShim\ShellShimTemplateFinder.cs (1)
24public async Task<string> ResolveAppHostSourceDirectoryAsync(string archOption, NuGetFramework targetFramework, Architecture arch)
src\sdk\src\Common\NuGetUtils.NuGet.cs (2)
38public static NuGetFramework? ParseFrameworkName(string? frameworkName) 40return frameworkName == null ? null : NuGetFramework.Parse(frameworkName);
ToolPackage\IToolPackage.cs (1)
30IEnumerable<NuGetFramework> Frameworks { get; }
ToolPackage\LocalToolsResolverCache.cs (1)
144NuGetFramework.Parse(cacheRow.TargetFramework),
ToolPackage\RestoredCommandIdentifier.cs (3)
18NuGetFramework targetFramework, 24public NuGetFramework TargetFramework { get; } = targetFramework ?? throw new ArgumentException(nameof(targetFramework)); 33EqualityComparer<NuGetFramework>.Default.Equals(TargetFramework, other.TargetFramework) &&
ToolPackage\ToolPackageDownloader.cs (2)
172NuGetFramework currentTargetFramework; 175currentTargetFramework = NuGetFramework.Parse(targetFramework);
ToolPackage\ToolPackageInstance.cs (5)
36public IEnumerable<NuGetFramework> Frameworks { get; private set; } 106.Select(path => NuGetFramework.ParseFolder(Path.GetFileName(path))).ToList(); 187.Select(path => NuGetFramework.ParseFolder(Path.GetFileName(path))) 193var currentFramework = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(Environment.Version.Major, Environment.Version.Minor)); 196var minRequiredFramework = availableFrameworks.MinBy(f => f.Version);
Microsoft.Build.NuGetSdkResolver (3)
RestoreRunnerEx.cs (3)
29private static readonly List<NuGetFramework> TargetFrameworks = new List<NuGetFramework> 57foreach (var tf in TargetFrameworks)
Microsoft.DotNet.ApiCompat.Task (6)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\ValidatePackageOptions.cs (2)
106public IReadOnlyDictionary<NuGetFramework, IEnumerable<string>>? PackageAssemblyReferences { get; set; } 111public IReadOnlyDictionary<NuGetFramework, IEnumerable<string>>? BaselinePackageAssemblyReferences { get; set; }
ValidatePackageTask.cs (4)
171private static Dictionary<NuGetFramework, IEnumerable<string>>? ParsePackageAssemblyReferences(ITaskItem[]? packageAssemblyReferences) 176Dictionary<NuGetFramework, IEnumerable<string>> packageAssemblyReferencesDict = new(packageAssemblyReferences.Length); 187NuGetFramework nuGetFramework = NuGetFramework.ParseComponents(targetFrameworkMoniker, targetPlatformMoniker);
Microsoft.DotNet.Build.Tasks.Packaging (164)
ApplyMetaPackages.cs (10)
77var fx = NuGetFramework.Parse(tfmSpecificSupression); 95Dictionary<string, HashSet<NuGetFramework>> metaPackagesToAdd = new Dictionary<string, HashSet<NuGetFramework>>(); 103var fx = NuGetFramework.Parse(tfm); 107HashSet<NuGetFramework> metaPackageFrameworks; 111metaPackagesToAdd[metaPackage] = metaPackageFrameworks = new HashSet<NuGetFramework>(); 129private bool ShouldSuppressMetapackage(Dictionary<string, HashSet<string>> suppressedMetaPackages, string metaPackage, NuGetFramework tfm) => 133private ITaskItem CreateDependency(string id, NuGetFramework targetFramework)
CreateTrimDependencyGroups.cs (6)
87foreach(var supportedInboxFramework in supportedInboxFrameworks) 151private bool IsSupported(NuGetFramework inboxFx, NuGetAssetResolver resolver) 185TargetFramework = NuGetFramework.Parse(item.GetMetadata(nameof(TargetFramework))); 209public NuGetFramework TargetFramework { get; } 220public TaskItemPackageDependencyGroup(NuGetFramework targetFramework, IEnumerable<TaskItemPackageDependency> packages) 226public NuGetFramework TargetFramework { get; }
Extensions.cs (5)
37public static NuGetFramework GetTargetFramework(this ITaskItem taskItem) 39NuGetFramework result = null; 43result = NuGetFramework.Parse(metadataValue); 49public static NuGetFramework GetTargetFrameworkMoniker(this ITaskItem taskItem) 51NuGetFramework result = null;
FrameworkUtilities.cs (16)
28NuGetFramework dependencyFramework = NuGetFramework.Parse(dependencyGroup); 31public static bool IsGenerationMoniker(NuGetFramework dependencyGroup) 36public static bool IsPortableMoniker(NuGetFramework nuGetFramework) 84NuGetFramework nuGetFrameworkName = NuGetFramework.Parse(frameworkName); 85var _frameworks = frameworks.Select(s => NuGetFramework.Parse(s)).ToList(); 86var nearest = Reducer.GetNearest(nuGetFrameworkName, _frameworks); 93public static NuGetFramework GetNearest(NuGetFramework framework, NuGetFramework[] frameworks) 97public static IEnumerable<NuGetFramework> ReduceDownwards(IEnumerable<NuGetFramework> frameworks) 102public static NuGetFramework ParseNormalized(string framework) 104NuGetFramework fx = NuGetFramework.Parse(framework);
GenerateNuSpec.cs (3)
286x.SupportedFrameworks.SequenceEqual(y.SupportedFrameworks, NuGetFramework.Comparer) 303TargetFramework = d.GetTargetFramework() ?? NuGetFramework.AnyFramework, 493public NuGetFramework TargetFramework { get; set; }
GeneratePackageReport.cs (11)
18private Dictionary<NuGetFramework, string[]> _frameworks; 94var fx = framework.Key; 198_frameworks = new Dictionary<NuGetFramework, string[]>(NuGetFramework.Comparer); 205NuGetFramework fx; 216if (fx.Equals(NuGetFramework.UnsupportedFramework)) 226var fileFrameworks = _targetPathToPackageItem.Values.Select(f => f.TargetFramework).Distinct(NuGetFramework.Comparer).Where(f => f != null); 227foreach(var fileFramework in fileFrameworks) 241foreach (var inboxFramework in inboxFrameworks) 252foreach(var framework in _frameworks.Keys.ToArray()) 256foreach (var derivedFx in derivedFxs)
GetApplicableAssetsFromPackageReports.cs (2)
62NuGetFramework fx = NuGetFramework.Parse(TargetMoniker);
GetApplicableAssetsFromPackages.cs (6)
82NuGetFramework[] compileFxs = TargetMonikers.Select(fx => NuGetFramework.Parse(fx)).ToArray(); 83NuGetFramework[] runtimeFxs = compileFxs; 87runtimeFxs = RuntimeTargetMonikers.Select(fx => NuGetFramework.Parse(fx)).ToArray(); 95foreach (var compileFx in compileFxs) 119foreach (var runtimeFx in runtimeFxs)
GetLayoutFiles.cs (4)
46i => NuGetFramework.Parse(i.ItemSpec), 52NuGetFramework.Comparer); 67var fx = NuGetFramework.Parse(targetParts[0]);
GetMinimumNETStandard.cs (2)
31var minNETStandard = Frameworks.Select(fx => NuGetFramework.Parse(fx.ItemSpec))
GetPackageDestination.cs (10)
74var nuGetFx = NuGetFramework.Parse(NuGetTargetMoniker); 76var suppressions = new HashSet<NuGetFramework>( 78s => NuGetFramework.Parse(s)), 79NuGetFramework.Comparer); 86var packageFx = NuGetFramework.Parse(packageTargetFramework.ItemSpec); 98var portableFx = NuGetFramework.Parse(portableFramework); 135private void Add(NuGetFramework framework, string runtime)
GetSupportedPackagesFromPackageReports.cs (2)
38var nugetFx = NuGetFramework.Parse(fx);
HarvestPackage.cs (2)
181NuGetFramework fx; 192if (fx.Equals(NuGetFramework.UnsupportedFramework))
NuGetAssetResolver.cs (11)
38public ContentItemGroup GetCompileItems(NuGetFramework framework) 52public IEnumerable<string> ResolveCompileAssets(NuGetFramework framework) 63public ContentItemGroup GetRuntimeItems(NuGetFramework framework, string runtimeIdentifier) 73public IEnumerable<string> ResolveRuntimeAssets(NuGetFramework framework, string runtimeId) 185public IReadOnlyDictionary<string, ContentItemGroup> GetCompileItems(NuGetFramework framework) 206public IEnumerable<string> ResolveCompileAssets(NuGetFramework framework, string referencePackageId) 219public IEnumerable<string> ResolveCompileAssets(NuGetFramework framework) 237public IReadOnlyDictionary<string, ContentItemGroup> GetRuntimeItems(NuGetFramework framework, string runtimeIdentifier) 255public IReadOnlyDictionary<string, ContentItemGroup> GetNativeItems(NuGetFramework framework, string runtimeIdentifier) 288public IEnumerable<string> ResolveRuntimeAssets(NuGetFramework framework, string runtimeId) 305public IEnumerable<string> ResolveNativeAssets(NuGetFramework framework, string runtimeId)
PackageIndex.cs (30)
190public void MergeInboxFromLayout(NuGetFramework framework, string layoutDirectory, bool addPackages = true) 206NuGetFramework framework = NuGetFramework.Parse(targetFrameworkMoniker); 214public void MergeFrameworkList(NuGetFramework framework, string frameworkListPath, bool addPackages = true) 227private void TryAddInbox(string assemblyName, NuGetFramework framework, Version version, bool addPackages = true) 255public IEnumerable<NuGetFramework> GetAlllInboxFrameworks() 261public IEnumerable<NuGetFramework> GetInboxFrameworks(string assemblyName) 263IEnumerable<NuGetFramework> inboxFrameworks = null; 274public IEnumerable<NuGetFramework> GetInboxFrameworks(string assemblyName, string assemblyVersionString) 281public IEnumerable<NuGetFramework> GetInboxFrameworks(string assemblyName, Version assemblyVersion) 283IEnumerable<NuGetFramework> inboxFrameworks = null; 294public bool IsInbox(string assemblyName, NuGetFramework framework, string assemblyVersionString) 301public bool IsInbox(string assemblyName, NuGetFramework framework, Version assemblyVersion) 453public Version GetPackageVersionForAssemblyVersion(NuGetFramework framework, Version assemblyVersion) 494public void AddInboxVersion(NuGetFramework framework, Version assemblyVersion) 496var normalizedFramework = NormalizeFramework(framework); 553public IEnumerable<NuGetFramework> GetInboxFrameworks() 559var fx = FromFrameworkKeyAndVersion(framework.Key, frameworkVersion); 566public IEnumerable<KeyValuePair<NuGetFramework, Version>> GetInboxVersions() 575var fx = FromFrameworkKeyAndVersion(framework.Key, frameworkVersion); 577yield return new KeyValuePair<NuGetFramework, Version>(fx, assemblyVersion); 582public bool IsAnyVersionInbox(NuGetFramework framework) 584var normalizedFramework = NormalizeFramework(framework); 597public bool IsInbox(NuGetFramework framework, Version assemblyVersion, bool permitRevisions = false) 599var normalizedFramework = NormalizeFramework(framework); 649private static NuGetFramework NormalizeFramework(NuGetFramework framework) 669private static string GetFrameworkKey(NuGetFramework framework) 678private static NuGetFramework FromFrameworkKeyAndVersion(string key, Version version) 710result.AddInboxVersion(NuGetFramework.Parse(property.Name), version);
PackageItem.cs (2)
23TargetFramework = NuGetFramework.Parse(value); 95public NuGetFramework TargetFramework { get; }
PackageReport.cs (7)
70return objectType == typeof(NuGetFramework); 83return NuGetFramework.Parse((string)reader.Value); 87throw new JsonSerializationException($"Failed to parse {nameof(NuGetFramework)} {reader.Value}. Line {lineInfo.LineNumber}, position {lineInfo.LinePosition}", exception); 90throw new JsonSerializationException($"Unexpected token type {reader.TokenType} when parsing {nameof(NuGetFramework)}. Line {lineInfo.LineNumber}, position {lineInfo.LinePosition}"); 100else if (value is NuGetFramework) 106throw new JsonSerializationException($"Expected {nameof(NuGetFramework)} but got {value.GetType()}"); 137public NuGetFramework TargetFramework { get; set;}
PromoteDependencies.cs (7)
44var refSets = dependencies.Where(d => d.Id != "_._").Where(d => d.IsReference).GroupBy(d => NuGetFramework.Parse(d.TargetFramework)).ToDictionary(g => g.Key, g => g.ToArray()); 49var libSets = dependencies.Where(d => !d.IsReference).GroupBy(d => NuGetFramework.Parse(d.TargetFramework)).ToDictionary(g => g.Key, g => g.ToArray()); 56foreach (var refFx in refFxs) 59var nearestLibFx = FrameworkUtilities.GetNearest(refFx, libFxs); 70foreach (var libFx in libFxs) 73var nearestRefFx = FrameworkUtilities.GetNearest(libFx, refFxs); 87private IEnumerable<ITaskItem> CopyDependencies(IEnumerable<Dependency> dependencies, NuGetFramework targetFramework)
SplitDependenciesBySupport.cs (6)
50foreach (var netStandardGroup in netStandardGroups) 72TargetFramework = NuGetFramework.Parse(fx); 82MinimumNETStandard = NuGetFramework.Parse(minNSFx); 92public NuGetFramework TargetFramework { get; set; } 93public NuGetFramework MinimumNETStandard { get; } 95public ITaskItem GetItemWithTargetFramework(NuGetFramework framework)
SplitReferences.cs (2)
62NuGetFramework targetFx = NuGetFramework.Parse(TargetFramework);
UpdatePackageIndex.cs (2)
172var targetFramework = NuGetFramework.Parse(inboxFrameworkLayoutFolder.GetMetadata("TargetFramework"));
ValidateFrameworkPackage.cs (3)
38var fx = NuGetFramework.Parse(Framework); 85private IEnumerable<PackageAsset> GetTestAssets(NuGetFramework fx, string runtimeId)
ValidatePackage.cs (14)
115private Dictionary<NuGetFramework, ValidationFramework> _frameworks; 176NuGetFramework fx = validateFramework.Framework; 455_frameworks = new Dictionary<NuGetFramework, ValidationFramework>(); 460NuGetFramework fx; 471if (fx.Equals(NuGetFramework.UnsupportedFramework)) 494HashSet<NuGetFramework> explicitlySupportedFrameworks = new HashSet<NuGetFramework>(NuGetFramework.Comparer); 499NuGetFramework fx; 517if (fx.Equals(NuGetFramework.UnsupportedFramework)) 616var framework = NuGetFramework.Parse(supportedFramework.Key); 642public ValidationFramework(NuGetFramework framework) 648public NuGetFramework Framework { get; }
ValidationTask.cs (1)
86protected bool HasSuppression(Suppression key, NuGetFramework framework)
Microsoft.DotNet.Build.Tasks.TargetFramework (10)
ChooseBestP2PTargetFrameworkTask.cs (5)
57if (!TryParseFramework(CurrentProjectTargetFramework!, CurrentProjectTargetPlatform, errorMessage, Log, out var projectNuGetFramework)) 79NuGetFramework projectNuGetFramework, 111private static bool TryParseFramework(string targetFrameworkMoniker, string? targetPlatformMoniker, string errorMessage, Log logger, out NuGetFramework nugetFramework) 115? NuGetFramework.ParseComponents(targetFrameworkMoniker, targetPlatformMoniker) 116: NuGetFramework.Parse(targetFrameworkMoniker);
ChooseBestTargetFrameworksTask.cs (2)
36NuGetFramework framework = NuGetFramework.ParseFolder(buildTargetFramework.ItemSpec);
TargetFrameworkResolver.cs (3)
52public string? GetNearest(IEnumerable<string> frameworks, NuGetFramework framework) 54NuGetFramework frameworkWithoutPlatform = NuGetFramework.Parse(framework.DotNetFrameworkName);
Microsoft.DotNet.PackageTesting (21)
GetCompatiblePackageTargetFrameworks.cs (15)
16private static List<NuGetFramework> allTargetFrameworks = new(); 17private static Dictionary<NuGetFramework, HashSet<NuGetFramework>> packageTfmMapping = new(); 44IEnumerable<NuGetFramework> testFrameworks = GetTestFrameworks(package, minDotnetTargetFramework); 59public static IEnumerable<NuGetFramework> GetTestFrameworks(Package package, string minDotnetTargetFramework) 61List<NuGetFramework> frameworksToTest= new(); 62IEnumerable<NuGetFramework> packageTargetFrameworks = package.FrameworksInPackage; 65foreach (var item in packageTargetFrameworks) 78frameworksToTest.Add(NuGetFramework.Parse(minDotnetTargetFramework)); 89allTargetFrameworks.Add(NuGetFramework.Parse(tfm)); 95NuGetFramework forwardTfm = item.SupportedFrameworkRange.Max; 96NuGetFramework reverseTfm = item.TargetFrameworkRange.Min; 103packageTfmMapping.Add(forwardTfm, new HashSet<NuGetFramework> { reverseTfm }); 108private static List<ITaskItem> CreateItemFromTestFramework(string packageId, string version, IEnumerable<NuGetFramework> testFrameworks) 111foreach (var framework in testFrameworks)
NupkgParser.cs (1)
21NuGetFramework[] dependencyFrameworks = nuspecReader.GetDependencyGroups()
Package.cs (5)
14public IEnumerable<NuGetFramework> FrameworksInPackage { get; } 18public Package(string packageId, string version, IEnumerable<string> packageAssetPaths, IEnumerable<NuGetFramework> dependencyFrameworks) 30List<NuGetFramework> FrameworksInPackageList = CompileAssets.Select(t => (NuGetFramework)t.Properties["tfm"]).ToList(); 33FrameworksInPackageList.AddRange(RuntimeAssets.Select(t => (NuGetFramework)t.Properties["tfm"]).Distinct());
Microsoft.DotNet.PackageValidation (36)
ApiCompatRunnerExtensions.cs (3)
41if (leftContentItems[0].Properties.TryGetValue("tfm", out object? tfmObj) && tfmObj is NuGetFramework leftTargetFramework) 47if (fallbackAssemblyReferences is null && rightContentItems[0].Properties.TryGetValue("tfm", out tfmObj) && tfmObj is NuGetFramework rightTargetFramework) 83if (item.Properties.TryGetValue("tfm", out object? tfmObj) && tfmObj is NuGetFramework nuGetFramework)
Filtering\ITargetFrameworkFilter.cs (1)
24bool IsExcluded(NuGetFramework framework);
Filtering\TargetFrameworkFilter.cs (1)
21public bool IsExcluded(NuGetFramework framework) => IsExcluded(framework.GetShortFolderName());
Package.cs (14)
76public IReadOnlyDictionary<NuGetFramework, IEnumerable<string>>? AssemblyReferences { get; } 81public IReadOnlyList<NuGetFramework> FrameworksInPackage { get; } 87IReadOnlyDictionary<NuGetFramework, IEnumerable<string>>? assemblyReferences = null) 106FrameworksInPackage = CompileAssets.Select(t => (NuGetFramework)t.Properties["tfm"]) 107.Concat(RuntimeAssets.Select(t => (NuGetFramework)t.Properties["tfm"])) 123public static Package Create(string? packagePath, IReadOnlyDictionary<NuGetFramework, IEnumerable<string>>? packageAssemblyReferences = null) 149public IReadOnlyList<ContentItem>? FindBestRuntimeAssetForFramework(NuGetFramework framework) 165public IReadOnlyList<ContentItem>? FindBestRuntimeSpecificAssetForFramework(NuGetFramework framework) 182public IReadOnlyList<ContentItem>? FindBestRuntimeAssetForFrameworkAndRuntime(NuGetFramework framework, string rid) 198public IReadOnlyList<ContentItem>? FindBestCompileAssetForFramework(NuGetFramework framework) 216public IEnumerable<string>? FindBestAssemblyReferencesForFramework(NuGetFramework framework) 228Queue<NuGetFramework> tfmQueue = new(AssemblyReferences.Keys); 231NuGetFramework assemblyReferencesFramework = tfmQueue.Dequeue(); 233NuGetFramework? bestAssemblyReferencesFramework = NuGetFrameworkUtility.GetNearest(tfmQueue.Concat([framework]), assemblyReferencesFramework, (key) => key);
PackageExtensions.cs (1)
10public static bool SupportsRuntimeIdentifier(this NuGetFramework tfm, string rid) =>
Validators\BaselinePackageValidator.cs (1)
31foreach (NuGetFramework baselineTargetFramework in options.BaselinePackage.FrameworksInPackage)
Validators\CompatibleFrameworkInPackageValidator.cs (3)
39Queue<(NuGetFramework, IReadOnlyList<ContentItem>)> compileAssetsQueue = new(); 40foreach (NuGetFramework framework in options.Package.FrameworksInPackage.OrderByDescending(f => f.Version)) 49(NuGetFramework framework, IReadOnlyList<ContentItem> compileTimeAsset) = compileAssetsQueue.Dequeue();
Validators\CompatibleTFMValidator.cs (12)
18private static readonly Dictionary<NuGetFramework, HashSet<NuGetFramework>> s_packageTfmMapping = InitializeTfmMappings(); 29HashSet<NuGetFramework> compatibleTargetFrameworks = []; 30foreach (NuGetFramework item in options.Package.FrameworksInPackage) 39foreach (NuGetFramework framework in compatibleTargetFrameworks) 99private static Dictionary<NuGetFramework, HashSet<NuGetFramework>> InitializeTfmMappings() 101Dictionary<NuGetFramework, HashSet<NuGetFramework>> packageTfmMapping = []; 106NuGetFramework forwardTfm = item.SupportedFrameworkRange.Max; 107NuGetFramework reverseTfm = item.TargetFrameworkRange.Min; 108if (packageTfmMapping.TryGetValue(forwardTfm, out HashSet<NuGetFramework>? value))
Microsoft.NET.Build.Tasks (35)
FrameworkPackages\FrameworkPackages.cs (7)
27private static readonly ConcurrentDictionary<NuGetFramework, ConcurrentDictionary<string, FrameworkPackages>> FrameworkPackagesByFramework = []; 45public FrameworkPackages(NuGetFramework framework, string frameworkName) 51public FrameworkPackages(NuGetFramework framework, string frameworkName, FrameworkPackages frameworkPackages) 54public NuGetFramework Framework { get; } 82public static FrameworkPackages[] GetFrameworkPackages(NuGetFramework framework, string[] frameworkReferences, bool acceptNearestMatch = false) 95NuGetFramework nearestFramework; 118public static FrameworkPackages LoadFrameworkPackagesFromPack(Logger log, NuGetFramework framework, string frameworkName, string targetingPackRoot)
FrameworkPackages\FrameworkPackages.net9.0.cs (1)
18private static NuGetFramework Net90 { get; } = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(9, 0));
GenerateRuntimeConfigurationFiles.cs (1)
192runtimeOptions.Tfm = NuGetFramework.Parse(TargetFrameworkMoniker).GetShortFolderName();
GenerateSupportedTargetFrameworkAlias.cs (4)
32var targetFramework = NuGetFramework.Parse(TargetFrameworkMoniker); 42var currentTargetFramework = NuGetFramework.ParseComponents(tfm.ItemSpec, TargetPlatformMoniker);
GetNuGetShortFolderName.cs (1)
25NuGetShortFolderName = NuGetFramework
GetPackagesToPrune.cs (2)
219var nugetFramework = new NuGetFramework(targetFrameworkIdentifier, Version.Parse(targetFrameworkVersion)); 243var nugetFramework = new NuGetFramework(targetFrameworkIdentifier, Version.Parse(targetFrameworkVersion));
LockFileExtensions.cs (1)
21var nuGetFramework = NuGetUtils.ParseFrameworkName(frameworkAlias);
ProcessFrameworkReferences.cs (7)
608private bool KnownFrameworkReferenceAppliesToTargetFramework(NuGetFramework knownFrameworkReferenceTargetFramework) 816var packTargetFramework = NuGetFramework.Parse(pack.GetMetadata("TargetFramework")); 1281TargetFramework = NuGetFramework.Parse(item.GetMetadata("TargetFramework")); 1305public NuGetFramework TargetFramework { get; } 1340public readonly NuGetFramework TargetFramework => NuGetFramework.Parse(item.GetMetadata("TargetFramework"));
ResolveAppHosts.cs (2)
88var packTargetFramework = NuGetFramework.Parse(appHostPack.GetMetadata("TargetFramework"));
ResolvePackageAssets.cs (5)
1418var targetFramework = _lockFile.GetTargetAndThrowIfNotFound(_targetFramework, null).TargetFramework; 1588var parsedTargetGraph = NuGetFramework.Parse(alias); 1651var tfm = _lockFile.GetTargetAndThrowIfNotFound(_targetFramework, null).TargetFramework; 1668var tfm = _lockFile.GetTargetAndThrowIfNotFound(_targetFramework, null).TargetFramework;
ResolvePackageDependencies.cs (2)
257var parsedTargetGraph = NuGetFramework.Parse(targetGraph);
src\sdk\src\Common\NuGetUtils.NuGet.cs (2)
38public static NuGetFramework? ParseFrameworkName(string? frameworkName) 40return frameworkName == null ? null : NuGetFramework.Parse(frameworkName);
NuGet.Build.Tasks (14)
GetReferenceNearestTargetFrameworkTask.cs (14)
75var fallbackNuGetFrameworks = new List<NuGetFramework>(); 79if (!TryParseFramework(CurrentProjectTargetFramework, CurrentProjectTargetPlatform, errorMessage, logger, out var projectNuGetFramework)) 91if (!TryParseFramework(fallbackFramework, errorMessage, logger, out var nugetFramework)) 113NuGetFramework projectNuGetFramework, 114IList<NuGetFramework> fallbackNuGetFrameworks, 170foreach (var currentProjectTargetFramework in fallbackNuGetFrameworks) 199private static bool TryParseFramework(string framework, string errorMessage, MSBuildLogger logger, out NuGetFramework nugetFramework) 201nugetFramework = NuGetFramework.Parse(framework); 213private static bool TryParseFramework(string targetFrameworkMoniker, string targetPlatformMoniker, string errorMessage, MSBuildLogger logger, out NuGetFramework nugetFramework) 222? NuGetFramework.ParseComponents(targetFrameworkMoniker, targetPlatformMoniker) 223: NuGetFramework.Parse(targetFrameworkMoniker); 236private static NuGetFramework GetNuGetFramework(string targetAlias, string targetFrameworkMoniker, string targetPlatformMoniker) 241return NuGetFramework.Parse(targetAlias); 245return NuGetFramework.ParseComponents(targetFrameworkMoniker,
NuGet.Build.Tasks.Console (4)
MSBuildStaticGraphRestore.cs (4)
736NuGetFramework targetFramework = MSBuildProjectFrameworkUtility.GetProjectFramework( 744var packageTargetFallback = MSBuildStringUtility.Split(msBuildProjectInstance.GetProperty("PackageTargetFallback")).Select(NuGetFramework.Parse).ToList(); 746var assetTargetFallbackEnum = MSBuildStringUtility.Split(msBuildProjectInstance.GetProperty(nameof(TargetFrameworkInformation.AssetTargetFallback))).Select(NuGetFramework.Parse).ToList(); 750(targetFramework, ImmutableArray<NuGetFramework> imports, bool assetTargetFallback, bool warn) = AssetTargetFallbackUtility.GetFallbackFrameworkInformation(targetFramework, packageTargetFallback, assetTargetFallbackEnum);
NuGet.Build.Tasks.Pack (19)
PackTaskLogic.cs (19)
433k => NuGetFramework.Parse(k)) 482NuGetFramework.Parse(e.Key), 561if (string.IsNullOrEmpty(targetFramework) || NuGetFramework.Parse(targetFramework).IsSpecificFramework == false) 577private static ISet<NuGetFramework> ParseFrameworks(IPackTaskRequest<IMSBuildItem> request, IDictionary<string, string> targetAliasToNuGetFramework) 579var nugetFrameworks = new HashSet<NuGetFramework>(); 582nugetFrameworks = new HashSet<NuGetFramework>(request.TargetFrameworks.Select(targetFramework => 590return NuGetFramework.Parse(targetFramework); 752foreach (var framework in packArgs.PackTargetArgs.TargetFrameworks) 898var dependenciesByFramework = new Dictionary<NuGetFramework, HashSet<LibraryDependency>>(NuGetFrameworkFullComparer.Instance); 911IDictionary<NuGetFramework, HashSet<LibraryDependency>> dependenciesByFramework, 997Dictionary<NuGetFramework, HashSet<LibraryDependency>> dependenciesByFramework, 1000var packageSpecificNoWarnProperties = new Dictionary<string, HashSet<(NuGetLogCode, NuGetFramework)>>(StringComparer.OrdinalIgnoreCase); 1049Dictionary<NuGetFramework, HashSet<LibraryDependency>> dependenciesByFramework, 1052Dictionary<string, HashSet<(NuGetLogCode, NuGetFramework)>> packageSpecificNoWarnProperties) 1071Dictionary<NuGetFramework, HashSet<LibraryDependency>> dependenciesByFramework, 1074Dictionary<string, HashSet<(NuGetLogCode, NuGetFramework)>> packageSpecificNoWarnProperties) 1099Dictionary<string, HashSet<(NuGetLogCode, NuGetFramework)>> packageSpecificNoWarnProperties, 1133HashSet<(NuGetLogCode, NuGetFramework)> nowarnProperties = null; 1137nowarnProperties = new HashSet<(NuGetLogCode, NuGetFramework)>();
NuGet.CommandLine.XPlat (82)
_generated\12\PackageSearchJsonContext.PackageDependencyGroup.g.cs (6)
32ObjectWithParameterizedConstructorCreator = static args => new global::NuGet.Packaging.PackageDependencyGroup((global::NuGet.Frameworks.NuGetFramework)args[0], (global::System.Collections.Generic.IEnumerable<global::NuGet.Packaging.Core.PackageDependency>)args[1]), 35ConstructorAttributeProviderFactory = static () => typeof(global::NuGet.Packaging.PackageDependencyGroup).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(global::NuGet.Frameworks.NuGetFramework), typeof(global::System.Collections.Generic.IEnumerable<global::NuGet.Packaging.Core.PackageDependency>)}, modifiers: null), 51var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::NuGet.Frameworks.NuGetFramework> 66AttributeProviderFactory = static () => typeof(global::NuGet.Packaging.PackageDependencyGroup).GetProperty("TargetFramework", InstanceMemberBindingFlags, null, typeof(global::NuGet.Frameworks.NuGetFramework), global::System.Array.Empty<global::System.Type>(), null), 69properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::NuGet.Frameworks.NuGetFramework>(options, info0); 121ParameterType = typeof(global::NuGet.Frameworks.NuGetFramework),
_generated\36\PackageSearchJsonContext.GetJsonTypeInfo.g.cs (1)
42if (type == typeof(global::NuGet.Frameworks.NuGetFramework))
_generated\5\PackageSearchJsonContext.NuGetFramework.g.cs (74)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Frameworks.NuGetFramework>? _NuGetFramework; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Frameworks.NuGetFramework> NuGetFramework 22get => _NuGetFramework ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Frameworks.NuGetFramework>)Options.GetTypeInfo(typeof(global::NuGet.Frameworks.NuGetFramework)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Frameworks.NuGetFramework> Create_NuGetFramework(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::NuGet.Frameworks.NuGetFramework>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Frameworks.NuGetFramework> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::NuGet.Frameworks.NuGetFramework> 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::NuGet.Frameworks.NuGetFramework>(options, objectInfo); 56DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 58Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).Framework, 66AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("Framework", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 77DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 79Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).Version, 87AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("Version", InstanceMemberBindingFlags, null, typeof(global::System.Version), global::System.Array.Empty<global::System.Type>(), null), 98DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 100Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).Platform, 108AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("Platform", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 119DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 121Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).PlatformVersion, 129AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("PlatformVersion", InstanceMemberBindingFlags, null, typeof(global::System.Version), global::System.Array.Empty<global::System.Type>(), null), 140DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 142Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).HasPlatform, 150AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("HasPlatform", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 160DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 162Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).HasProfile, 170AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("HasProfile", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 180DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 182Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).Profile, 190AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("Profile", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 201DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 203Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).DotNetFrameworkName, 211AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("DotNetFrameworkName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 222DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 224Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).DotNetPlatformName, 232AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("DotNetPlatformName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 243DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 245Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).IsPCL, 253AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("IsPCL", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 263DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 265Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).IsPackageBased, 273AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("IsPackageBased", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 283DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 285Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).AllFrameworkVersions, 293AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("AllFrameworkVersions", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 303DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 305Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).IsUnsupported, 313AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("IsUnsupported", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 323DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 325Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).IsAgnostic, 333AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("IsAgnostic", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 343DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 345Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).IsAny, 353AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("IsAny", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 363DeclaringType = typeof(global::NuGet.Frameworks.NuGetFramework), 365Getter = static obj => ((global::NuGet.Frameworks.NuGetFramework)obj).IsSpecificFramework, 373AttributeProviderFactory = static () => typeof(global::NuGet.Frameworks.NuGetFramework).GetProperty("IsSpecificFramework", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null), 383private void NuGetFrameworkSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::NuGet.Frameworks.NuGetFramework? value) 393writer.WriteString(PropName_Framework, ((global::NuGet.Frameworks.NuGetFramework)value).Framework); 395global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::NuGet.Frameworks.NuGetFramework)value).Version, Version); 396writer.WriteString(PropName_Platform, ((global::NuGet.Frameworks.NuGetFramework)value).Platform); 398global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::NuGet.Frameworks.NuGetFramework)value).PlatformVersion, Version); 399writer.WriteBoolean(PropName_HasPlatform, ((global::NuGet.Frameworks.NuGetFramework)value).HasPlatform); 400writer.WriteBoolean(PropName_HasProfile, ((global::NuGet.Frameworks.NuGetFramework)value).HasProfile); 401writer.WriteString(PropName_Profile, ((global::NuGet.Frameworks.NuGetFramework)value).Profile); 402writer.WriteString(PropName_DotNetFrameworkName, ((global::NuGet.Frameworks.NuGetFramework)value).DotNetFrameworkName); 403writer.WriteString(PropName_DotNetPlatformName, ((global::NuGet.Frameworks.NuGetFramework)value).DotNetPlatformName); 404writer.WriteBoolean(PropName_IsPCL, ((global::NuGet.Frameworks.NuGetFramework)value).IsPCL); 405writer.WriteBoolean(PropName_IsPackageBased, ((global::NuGet.Frameworks.NuGetFramework)value).IsPackageBased); 406writer.WriteBoolean(PropName_AllFrameworkVersions, ((global::NuGet.Frameworks.NuGetFramework)value).AllFrameworkVersions); 407writer.WriteBoolean(PropName_IsUnsupported, ((global::NuGet.Frameworks.NuGetFramework)value).IsUnsupported); 408writer.WriteBoolean(PropName_IsAgnostic, ((global::NuGet.Frameworks.NuGetFramework)value).IsAgnostic); 409writer.WriteBoolean(PropName_IsAny, ((global::NuGet.Frameworks.NuGetFramework)value).IsAny); 410writer.WriteBoolean(PropName_IsSpecificFramework, ((global::NuGet.Frameworks.NuGetFramework)value).IsSpecificFramework);
Commands\PackageReferenceCommands\AddPackageReferenceCommandRunner.cs (1)
308internal static string GetAliasForFramework(PackageSpec spec, NuGetFramework framework)
NuGet.Commands (173)
CommandRunners\PackCommandRunner.cs (4)
300NuGetFramework framework, 325new FrameworkAssemblyReference(dependency.Name, new NuGetFramework[] { framework })); 334reference.SupportedFrameworks.Concat(new NuGetFramework[] { framework })); 599foreach (NuGetFramework framework in reference.SupportedFrameworks)
MSBuildPackTargetArgs.cs (1)
20public ISet<NuGetFramework> TargetFrameworks { get; set; }
MSBuildProjectFactory.cs (1)
141var tfm = NuGetFramework.Parse(file.TargetFramework).GetShortFolderName();
PackCommand\Logging\PackageSpecificWarningProperties.cs (11)
22internal IDictionary<NuGetLogCode, IDictionary<string, ISet<NuGetFramework>>> Properties { get; private set; } 29public static PackageSpecificWarningProperties CreatePackageSpecificWarningProperties(IDictionary<string, HashSet<(NuGetLogCode, NuGetFramework)>> noWarnProperties) 39foreach (KeyValuePair<string, HashSet<(NuGetLogCode, NuGetFramework)>> packageNoWarnProperty in noWarnProperties) 43foreach ((NuGetLogCode nuGetLogCode, NuGetFramework nuGetFramework) propertyPair in packageNoWarnProperty.Value) 58internal void Add(NuGetLogCode code, string libraryId, NuGetFramework framework) 60Properties ??= new Dictionary<NuGetLogCode, IDictionary<string, ISet<NuGetFramework>>>(); 62if (!Properties.TryGetValue(code, out IDictionary<string, ISet<NuGetFramework>> frameworksByLibraryId)) 64frameworksByLibraryId = new Dictionary<string, ISet<NuGetFramework>>(StringComparer.OrdinalIgnoreCase); 68if (!frameworksByLibraryId.TryGetValue(libraryId, out ISet<NuGetFramework> frameworks)) 70frameworks = new HashSet<NuGetFramework>(NuGetFrameworkFullComparer.Instance); 84internal bool Contains(NuGetLogCode code, string libraryId, NuGetFramework framework)
RestoreCommand\CompatibilityChecker.cs (9)
79var available = new List<NuGetFramework>(); 238private static IEnumerable<NuGetFramework> GetPackageFrameworks( 242var available = new HashSet<NuGetFramework>(); 271var tfm = tfmObj as NuGetFramework; 285private static List<NuGetFramework> GetProjectFrameworks(Library localLibrary) 287var available = new List<NuGetFramework>(); 294available = (List<NuGetFramework>)frameworksObject; 311&& targetFrameworkInformation.FrameworkName != NuGetFramework.UnsupportedFramework);
RestoreCommand\CompatibilityIssue.cs (17)
19public NuGetFramework Framework { get; } 23public List<NuGetFramework> AvailableFrameworks { get; } 30NuGetFramework framework, 32IEnumerable<NuGetFramework> availableFrameworks, 44public static CompatibilityIssue ReferenceAssemblyNotImplemented(string assemblyName, PackageIdentity referenceAssemblyPackage, NuGetFramework framework, string runtimeIdentifier) 52Enumerable.Empty<NuGetFramework>(), 58NuGetFramework framework, 60IEnumerable<NuGetFramework> packageFrameworks) 80availableFrameworks: Enumerable.Empty<NuGetFramework>(), 86NuGetFramework framework, 88IEnumerable<NuGetFramework> projectFrameworks) 102NuGetFramework framework, 111Enumerable.Empty<NuGetFramework>(), 256private static string FormatFramework(NuGetFramework framework) 264private static string FormatFramework(NuGetFramework framework, string runtimeId) 288new HashSet<NuGetFramework>(AvailableFrameworks, NuGetFramework.Comparer)
RestoreCommand\ContentFiles\ContentFileUtils.cs (2)
30NuGetFramework framework, 59(NuGetFramework)group.Properties[ManagedCodeConventions.PropertyNames.TargetFrameworkMoniker]);
RestoreCommand\DependencyGraphResolver.cs (1)
1409private static bool IsNewerThanNET10(NuGetFramework frameworkName)
RestoreCommand\DownloadDependencyResolutionResult.cs (3)
19public NuGetFramework Framework { get; } 37private DownloadDependencyResolutionResult(NuGetFramework framework, IList<Tuple<LibraryRange, RemoteMatch>> dependencies, ISet<RemoteMatch> install, ISet<LibraryRange> unresolved) 45public static DownloadDependencyResolutionResult Create(NuGetFramework framework, IList<Tuple<LibraryRange, RemoteMatch>> dependencies, IList<IRemoteDependencyProvider> remoteDependencyProviders)
RestoreCommand\FrameworkRuntimeDefinition.cs (2)
14public NuGetFramework Framework { get; } 20public FrameworkRuntimeDefinition(string targetAlias, NuGetFramework framework, string? runtimeIdentifier)
RestoreCommand\IRestoreTargetGraph.cs (2)
35/// Gets the <see cref="NuGetFramework" /> used during the restore operation on this graph 37NuGetFramework Framework { get; }
RestoreCommand\LockFileBuilder.cs (5)
233(LockFileTargetLibrary targetLibrary, bool usedFallbackFramework, NuGetFramework compileAssetFramework, NuGetFramework runtimeAssetFramework) = LockFileUtils.CreateLockFileTargetLibrary( 251var nonFallbackFramework = new NuGetFramework(target.TargetFramework); 418private static string GetFallbackFrameworkString(NuGetFramework framework) 422?? new List<NuGetFramework>();
RestoreCommand\LockFileBuilderCache.cs (15)
34private readonly ConcurrentDictionary<(CriteriaKey, string path, string aliases, LibraryIncludeFlags, int dependencyCount), Lazy<(LockFileTargetLibrary, bool, NuGetFramework, NuGetFramework)>> _lockFileTargetLibraryCache = 43/// For performance reasons(detecting AssetTargetFallback warnings), this is not used in the current restore code. <see cref="GetLabeledSelectionCriteria(RestoreTargetGraph, NuGetFramework)"/> is used instead. 46public List<List<SelectionCriteria>> GetSelectionCriteria(RestoreTargetGraph graph, NuGetFramework framework) 67internal List<(List<SelectionCriteria>, bool)> GetLabeledSelectionCriteria(RestoreTargetGraph graph, NuGetFramework framework) 109internal (LockFileTargetLibrary, bool, NuGetFramework, NuGetFramework) GetLockFileTargetLibrary(RestoreTargetGraph graph, NuGetFramework framework, LocalPackageInfo localPackageInfo, string aliases, LibraryIncludeFlags libraryIncludeFlags, List<LibraryDependency> dependencies, Func<(LockFileTargetLibrary, bool, NuGetFramework, NuGetFramework)> valueFactory) 120key => new Lazy<(LockFileTargetLibrary, bool, NuGetFramework, NuGetFramework)>(valueFactory)).Value; 127public NuGetFramework Framework { get; } 131public CriteriaKey(string targetGraphName, NuGetFramework frameworkOverride) 159&& NuGetFramework.Comparer.Equals(Framework, other.Framework)
RestoreCommand\Logging\TransitiveNoWarnUtils.cs (1)
101var parentTargetFramework = targetGraph.Framework;
RestoreCommand\MonoAndroidDeprecation.cs (2)
22internal static bool ShouldCheck(PackageSpec project, NuGetFramework framework) 50internal static bool IsMonoAndroidFramework(NuGetFramework framework)
RestoreCommand\ProjectRestoreCommand.cs (4)
47IDictionary<NuGetFramework, string> frameworkToAlias, 118FirstOrDefault(e => NuGetFramework.Comparer.Equals(e.FrameworkName, graph.Framework))?.RuntimeIdentifierGraphPath; 258NuGetFramework framework, 275NuGetFramework framework,
RestoreCommand\RestoreCommand.cs (8)
34private static readonly ConcurrentDictionary<NuGetFramework, string> _frameworkShortNameCache = new(NuGetFrameworkFullComparer.Instance); 855IEnumerable<NuGetFramework> badPlatforms = _request.Project.TargetFrameworks 1864Dictionary<NuGetFramework, string> targetFrameworkToAlias = new(NuGetFramework.Comparer); 1965var currentGraphs = new HashSet<KeyValuePair<NuGetFramework, string>>( 1966allGraphs.Select(graph => new KeyValuePair<NuGetFramework, string>( 1973var key = new KeyValuePair<NuGetFramework, string>( 2184var seenFrameworks = new HashSet<NuGetFramework>(packageSpec.TargetFrameworks.Count);
RestoreCommand\RestoreTargetGraph.cs (4)
28/// Gets the <see cref="NuGetFramework" /> used during the restore operation on this graph 30public NuGetFramework Framework { get; } 68NuGetFramework framework, 117NuGetFramework framework,
RestoreCommand\SourceRepositoryDependencyProvider.cs (6)
180NuGetFramework targetFramework, 317NuGetFramework targetFramework, 356NuGetFramework targetFramework, 520NuGetFramework targetFramework) 557private static NuGetFramework DeconstructFallbackFrameworks(NuGetFramework nuGetFramework)
RestoreCommand\Utility\LockFileUtils.cs (30)
61internal static (LockFileTargetLibrary, bool, NuGetFramework, NuGetFramework) CreateLockFileTargetLibrary( 67NuGetFramework targetFrameworkOverride, 72var framework = targetFrameworkOverride ?? targetGraph.Framework; 78NuGetFramework compileAssetFramework = null; 79NuGetFramework runtimeAssetFramework = null; 121internal static List<(List<SelectionCriteria>, bool)> CreateOrderedCriteriaSets(ManagedCodeConventions codeConventions, NuGetFramework framework, string runtimeIdentifier) 170internal static (LockFileTargetLibrary lockFileLib, NuGetFramework compileAssetFramework, NuGetFramework runtimeAssetFramework) CreateLockFileTargetLibrary( 176NuGetFramework framework, 203out NuGetFramework compileFramework, 212out NuGetFramework runtimeFramework, 304private static void AddContentFiles(ManagedCodeConventions managedCodeConventions, LockFileTargetLibrary lockFileLib, NuGetFramework framework, ContentItemCollection contentItems, NuspecReader nuspec) 332NuGetFramework framework, 378private static void AddFrameworkReferences(LockFileTargetLibrary lockFileLib, NuGetFramework framework, NuspecReader nuspec) 405private static void ApplyReferenceFilter(LockFileTargetLibrary lockFileLib, NuGetFramework framework, NuspecReader nuspec) 430private static void ApplyLibContract(LocalPackageInfo package, LockFileTargetLibrary lockFileLib, NuGetFramework framework, ContentItemCollection contentItems) 444private static void AddDependencies(IEnumerable<LibraryDependency> dependencies, LockFileTargetLibrary lockFileLib, NuGetFramework framework, NuspecReader nuspec) 450NuGetFramework currentFramework = framework; 509?? NuGetFramework.UnsupportedFramework.DotNetFrameworkName; 674out NuGetFramework selectedFramework, 691selectedFramework = tfmObj as NuGetFramework; 786NuGetFramework framework, 810var primaryFramework = NuGetFramework.Parse(fallbackFramework.DotNetFrameworkName); 821foreach (var fallback in fallbackFramework.Fallback) 888NuGetFramework framework, 929return (NuGetFramework)frameworkObj; 932return NuGetFramework.AnyFramework; 947NuGetFramework framework,
RestoreCommand\Utility\MSBuildRestoreUtility.cs (5)
453NuGetFramework targetFramework = MSBuildProjectFrameworkUtility.GetProjectFramework( 462ImmutableArray<NuGetFramework> imports = []; 469.Select(NuGetFramework.Parse) 473.Select(NuGetFramework.Parse) 899FrameworkName = NuGetFramework.Parse(tfmProperty),
RestoreCommand\Utility\PackageSpecFactory.cs (4)
388NuGetFramework targetFramework = MSBuildProjectFrameworkUtility.GetProjectFramework( 396var packageTargetFallback = MSBuildStringUtility.Split(msBuildProjectInstance.GetProperty("PackageTargetFallback")).Select(NuGetFramework.Parse).ToList(); 398var assetTargetFallbackEnum = MSBuildStringUtility.Split(msBuildProjectInstance.GetProperty(nameof(TargetFrameworkInformation.AssetTargetFallback))).Select(NuGetFramework.Parse).ToList(); 402(targetFramework, ImmutableArray<NuGetFramework> imports, bool assetTargetFallback, bool warn) = AssetTargetFallbackUtility.GetFallbackFrameworkInformation(targetFramework, packageTargetFallback, assetTargetFallbackEnum);
RestoreCommand\Utility\SpecValidationUtility.cs (2)
152List<NuGetFramework> frameworkNames = new List<NuGetFramework>(spec.TargetFrameworks.Count);
RestoreCommand\Utility\ToolRestoreUtility.cs (1)
24public static PackageSpec GetSpec(string projectFilePath, string id, VersionRange versionRange, NuGetFramework framework, string packagesPath, IList<string> fallbackFolders, IList<PackageSource> sources, WarningProperties projectWideWarningProperties)
Utility\AssetTargetFallbackUtility.cs (13)
22public static void EnsureValidFallback(IEnumerable<NuGetFramework> packageTargetFallback, IEnumerable<NuGetFramework> assetTargetFallback, string filePath) 43public static NuGetFramework GetFallbackFramework(NuGetFramework projectFramework, IEnumerable<NuGetFramework> packageTargetFallback, IEnumerable<NuGetFramework> assetTargetFallback) 62public static (NuGetFramework frameworkName, ImmutableArray<NuGetFramework> imports, bool assetTargetFallback, bool warn) GetFallbackFrameworkInformation(NuGetFramework originalFrameworkName, IEnumerable<NuGetFramework> packageTargetFallback, IEnumerable<NuGetFramework> assetTargetFallbackEnum) 65var frameworkName = GetFallbackFramework( 70ImmutableArray<NuGetFramework> imports = [];
Utility\Extensions.cs (1)
26public static ISet<LibraryDependency> GetPackageDependenciesForFramework(this PackageSpec project, NuGetFramework framework)
Utility\MSBuildProjectFrameworkUtility.cs (19)
51public static NuGetFramework GetProjectFramework( 70public static NuGetFramework GetProjectFramework( 171internal static NuGetFramework GetProjectFramework( 201return NuGetFramework.Parse("SCMPInfra, Version=0.0"); 238return NuGetFramework.Parse($"{effectivePlatformIdentifier}, Version={effectivePlatformVersion}"); 251return NuGetFramework.Parse($"{effectivePlatformIdentifier}, Version={effectivePlatformVersion}"); 266return NuGetFramework.Parse(currentFrameworkString); 269NuGetFramework framework = NuGetFramework.ParseComponents(currentFrameworkString, platformMoniker); 292return NuGetFramework.UnsupportedFramework; 295private static NuGetFramework GetFrameworkFromMoniker(string platformIdentifier, string platformMoniker, string platformMinVersion) 299return NuGetFramework.Parse($"{platformIdentifier}, Version={platformMinVersion}"); 303return NuGetFramework.Parse(platformMoniker); 318public static IEnumerable<NuGetFramework> GetProjectFrameworks(IEnumerable<string> frameworkStrings) 325var frameworks = new List<NuGetFramework>(); 329var parsed = NuGetFramework.Parse(frameworkString); 347public static NuGetFramework GetProjectFrameworkReplacement(NuGetFramework framework)
NuGet.Common (4)
Errors\IPackLogMessage.cs (1)
18public NuGetFramework? Framework { get; set; }
Errors\PackagingLogMessage.cs (3)
23public NuGetFramework? Framework { get; set; } 42private PackagingLogMessage(LogLevel logLevel, NuGetLogCode logCode, string message, string? libraryId, NuGetFramework? framework) 75public static PackagingLogMessage CreateWarning(string message, NuGetLogCode code, string? libraryId, NuGetFramework? framework)
NuGet.DependencyResolver.Core (27)
LibraryRangeCacheKey.cs (2)
17public LibraryRangeCacheKey(LibraryRange range, NuGetFramework framework, string? alias) 27public NuGetFramework Framework { get; }
LockFileCacheKey.cs (3)
18public NuGetFramework TargetFramework { get; } 27public LockFileCacheKey(NuGetFramework framework, string? runtimeIdentifier, string? targetAlias) 52&& NuGetFramework.Comparer.Equals(TargetFramework, other.TargetFramework)
Providers\IDependencyProvider.cs (2)
15Library? GetLibrary(LibraryRange libraryRange, NuGetFramework targetFramework); 17Library? GetLibrary(LibraryRange libraryRange, NuGetFramework targetFramework, string? alias);
Providers\IRemoteDependencyProvider.cs (2)
66NuGetFramework targetFramework, 94NuGetFramework targetFramework,
Providers\LocalDependencyProvider.cs (2)
75NuGetFramework targetFramework, 117NuGetFramework targetFramework,
Remote\RemoteDependencyWalker.cs (3)
30public async Task<GraphNode<RemoteResolveResult>> WalkAsync(LibraryRange library, NuGetFramework framework, string runtimeIdentifier, RuntimeGraph runtimeGraph, bool recursive) 71NuGetFramework framework, 585NuGetFramework framework,
ResolverUtility.cs (13)
22NuGetFramework framework, 38NuGetFramework framework, 113NuGetFramework framework, 158NuGetFramework framework, 184NuGetFramework framework, 222var targetFramework = framework; 292var match = await FindPackageLibraryMatchAsync(libraryRange, NuGetFramework.AnyFramework, remoteDependencyProviders, remoteWalkContext.LocalLibraryProviders, remoteWalkContext.CacheContext, remoteWalkContext.Logger, cancellationToken); 301private static async Task<RemoteMatch?> FindPackageLibraryMatchAsync(LibraryRange libraryRange, NuGetFramework framework, IEnumerable<IRemoteDependencyProvider> remoteProviders, IEnumerable<IRemoteDependencyProvider> localProviders, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken) 381NuGetFramework framework, 390NuGetFramework framework, 433NuGetFramework framework, 496NuGetFramework framework, 536NuGetFramework framework, SourceCacheContext cacheContext, ILogger logger, CancellationToken token)
NuGet.Frameworks (581)
AssetTargetFallbackFramework.cs (7)
8using FallbackList = System.Collections.Generic.IReadOnlyList<NuGet.Frameworks.NuGetFramework>; 28public NuGetFramework RootFramework { get; } 30public AssetTargetFallbackFramework(NuGetFramework framework, FallbackList fallbackFrameworks) 48private static NuGetFramework ValidateFrameworkArgument(NuGetFramework framework) 81foreach (var each in Fallback) 104return NuGetFramework.Comparer.Equals(this, other)
comparers\FrameworkPrecedenceSorter.cs (3)
12public class FrameworkPrecedenceSorter : IComparer<NuGetFramework> 23public int Compare(NuGetFramework? x, NuGetFramework? y)
comparers\FrameworkRangeComparer.cs (2)
32NuGetFramework.Comparer.Equals(x.Min, y.Min) && NuGetFramework.Comparer.Equals(x.Max, y.Max)
comparers\NuGetFrameworkFullComparer.cs (4)
13public class NuGetFrameworkFullComparer : IEqualityComparer<NuGetFramework> 19public bool Equals(NuGetFramework? x, NuGetFramework? y) 40public int GetHashCode(NuGetFramework obj)
comparers\NuGetFrameworkNameComparer.cs (4)
12public class NuGetFrameworkNameComparer : IEqualityComparer<NuGetFramework> 20public bool Equals(NuGetFramework? x, NuGetFramework? y) 36public int GetHashCode(NuGetFramework obj)
comparers\NuGetFrameworkSorter.cs (3)
14public class NuGetFrameworkSorter : IComparer<NuGetFramework> 22public int Compare(NuGetFramework? x, NuGetFramework? y)
CompatibilityCacheKey.cs (4)
15public NuGetFramework Target { get; } 17public NuGetFramework Candidate { get; } 21public CompatibilityCacheKey(NuGetFramework target, NuGetFramework candidate)
CompatibilityListProvider.cs (4)
23public IEnumerable<NuGetFramework> GetFrameworksSupporting(NuGetFramework target) 39private IEnumerable<NuGetFramework> ReduceDownwards(IEnumerable<NuGetFramework> frameworks)
CompatibilityProvider.cs (32)
31public bool IsCompatible(NuGetFramework target, NuGetFramework candidate) 51private bool? IsCompatibleCore(NuGetFramework target, NuGetFramework candidate) 85private bool? IsSpecialFrameworkCompatible(NuGetFramework target, NuGetFramework candidate) 112private bool IsPCLCompatible(NuGetFramework target, NuGetFramework candidate) 119IEnumerable<NuGetFramework>? targetFrameworks; 120IEnumerable<NuGetFramework>? candidateFrameworks; 127targetFrameworks = Array.Empty<NuGetFramework>(); 132targetFrameworks = new NuGetFramework[] { target }; 140candidateFrameworks = Array.Empty<NuGetFramework>(); 145candidateFrameworks = new NuGetFramework[] { candidate }; 152private bool PCLInnerCompare(IEnumerable<NuGetFramework> targetFrameworks, IEnumerable<NuGetFramework> candidateFrameworks) 158private bool IsCompatibleWithTarget(NuGetFramework target, NuGetFramework candidate) 161var targetSet = new List<NuGetFramework>() { target }; 164var candidateSet = new List<NuGetFramework>() { candidate }; 168foreach (var currentCandidate in candidateSet) 179private static bool IsCompatibleWithTargetCore(NuGetFramework target, NuGetFramework candidate) 183if (isNet6Era && target.HasPlatform && !NuGetFramework.FrameworkNameComparer.Equals(target, candidate)) 200result = NuGetFramework.FrameworkNameComparer.Equals(target, candidate) 250private IEnumerable<NuGetFramework> GetEquivalentFrameworksClosure(NuGetFramework framework) 253var seen = new HashSet<NuGetFramework>() { framework }; 255var toExpand = new Stack<NuGetFramework>(); 260var frameworkToExpand = toExpand.Pop(); 262if (_mappings.TryGetEquivalentFrameworks(frameworkToExpand, out IEnumerable<NuGetFramework>? compatibleFrameworks)) 264foreach (var curFramework in compatibleFrameworks)
CompatibilityTable.cs (20)
18private readonly Dictionary<NuGetFramework, HashSet<NuGetFramework>> _table; 21public CompatibilityTable(IEnumerable<NuGetFramework> frameworks) 28public CompatibilityTable(IEnumerable<NuGetFramework> frameworks, IFrameworkNameProvider mappings, IFrameworkCompatibilityProvider compat) 43public bool HasFramework(NuGetFramework framework) 51public IEnumerable<NuGetFramework> GetNearest(NuGetFramework framework) 64public bool TryGetCompatible(NuGetFramework framework, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? compatible) 66if (_table.TryGetValue(framework, out HashSet<NuGetFramework>? frameworks)) 68compatible = new HashSet<NuGetFramework>(frameworks); 76private static Dictionary<NuGetFramework, HashSet<NuGetFramework>> GetTable(IEnumerable<NuGetFramework> frameworks, IFrameworkCompatibilityProvider compat) 79var input = new HashSet<NuGetFramework>(frameworks.Where(f => f.IsSpecificFramework)); 80var table = new Dictionary<NuGetFramework, HashSet<NuGetFramework>>(); 82foreach (var framework in input) 84var compatFrameworks = new HashSet<NuGetFramework>(); 87foreach (var testFramework in input)
def\IFrameworkCompatibilityListProvider.cs (2)
15IEnumerable<NuGetFramework> GetFrameworksSupporting(NuGetFramework target);
def\IFrameworkCompatibilityProvider.cs (2)
15bool IsCompatible(NuGetFramework framework, NuGetFramework other);
def\IFrameworkMappings.cs (7)
36IEnumerable<KeyValuePair<NuGetFramework, NuGetFramework>> EquivalentFrameworks { get; } 67/// in consideration are package based (determined by <see cref="NuGetFramework.IsPackageBased"/>). 81IEnumerable<KeyValuePair<NuGetFramework, NuGetFramework>> ShortNameReplacements { get; } 87IEnumerable<KeyValuePair<NuGetFramework, NuGetFramework>> FullNameReplacements { get; }
def\IFrameworkNameProvider.cs (21)
56bool TryGetPortableProfile(IEnumerable<NuGetFramework> supportedFrameworks, out int profileNumber); 61bool TryGetPortableFrameworks(int profile, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks); 66bool TryGetPortableFrameworks(int profile, bool includeOptional, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks); 72bool TryGetPortableFrameworks(string profile, bool includeOptional, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks); 78bool TryGetPortableFrameworks(string shortPortableProfiles, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks); 91bool TryGetEquivalentFrameworks(NuGetFramework framework, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks); 96bool TryGetEquivalentFrameworks(FrameworkRange range, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks); 102bool TryGetCompatibilityMappings(NuGetFramework framework, [NotNullWhen(true)] out IEnumerable<FrameworkRange>? supportedFrameworkRanges); 125int CompareFrameworks(NuGetFramework? x, NuGetFramework? y); 131/// <see cref="TryGetEquivalentFrameworks(NuGetFramework, out IEnumerable{NuGetFramework})"/>). 133int CompareEquivalentFrameworks(NuGetFramework? x, NuGetFramework? y); 139NuGetFramework GetShortNameReplacement(NuGetFramework framework); 145NuGetFramework GetFullNameReplacement(NuGetFramework framework); 150IEnumerable<NuGetFramework> GetNetStandardVersions(); 155IEnumerable<NuGetFramework> GetCompatibleCandidates();
def\IFrameworkSpecific.cs (1)
14NuGetFramework TargetFramework { get; }
def\IPortableFrameworkMappings.cs (2)
13IEnumerable<KeyValuePair<int, NuGetFramework[]>> ProfileFrameworks { get; } 19IEnumerable<KeyValuePair<int, NuGetFramework[]>> ProfileOptionalFrameworks { get; }
DefaultFrameworkMappings.cs (74)
114private static readonly Lazy<KeyValuePair<NuGetFramework, NuGetFramework>[]> EquivalentFrameworksLazy = new Lazy<KeyValuePair<NuGetFramework, NuGetFramework>[]>(() => 119new KeyValuePair<NuGetFramework, NuGetFramework>( 124new KeyValuePair<NuGetFramework, NuGetFramework>( 129new KeyValuePair<NuGetFramework, NuGetFramework>( 134new KeyValuePair<NuGetFramework, NuGetFramework>( 139new KeyValuePair<NuGetFramework, NuGetFramework>( 144new KeyValuePair<NuGetFramework, NuGetFramework>( 149new KeyValuePair<NuGetFramework, NuGetFramework>( 154new KeyValuePair<NuGetFramework, NuGetFramework>( 159new KeyValuePair<NuGetFramework, NuGetFramework>( 164new KeyValuePair<NuGetFramework, NuGetFramework>( 169new KeyValuePair<NuGetFramework, NuGetFramework>( 174new KeyValuePair<NuGetFramework, NuGetFramework>( 179new KeyValuePair<NuGetFramework, NuGetFramework>( 184new KeyValuePair<NuGetFramework, NuGetFramework>( 189new KeyValuePair<NuGetFramework, NuGetFramework>( 194new KeyValuePair<NuGetFramework, NuGetFramework>( 199new KeyValuePair<NuGetFramework, NuGetFramework>( 205new KeyValuePair<NuGetFramework, NuGetFramework>( 210new KeyValuePair<NuGetFramework, NuGetFramework>( 215new KeyValuePair<NuGetFramework, NuGetFramework>( 220new KeyValuePair<NuGetFramework, NuGetFramework>( 226public IEnumerable<KeyValuePair<NuGetFramework, NuGetFramework>> EquivalentFrameworks 511NuGetFramework framework, 512NuGetFramework netPlatform) 524NuGetFramework framework, 525NuGetFramework netPlatform) 537NuGetFramework framework, 538NuGetFramework netPlatform, 539NuGetFramework netStandard) 547NuGetFramework netPlatform, 548NuGetFramework netStandard) 550var lowestFramework = new NuGetFramework(framework, FrameworkConstants.EmptyVersion); 619private static readonly Lazy<KeyValuePair<NuGetFramework, NuGetFramework>[]> ShortNameReplacementsLazy = new Lazy<KeyValuePair<NuGetFramework, NuGetFramework>[]>(() => 623new KeyValuePair<NuGetFramework, NuGetFramework>(FrameworkConstants.CommonFrameworks.DotNet50, FrameworkConstants.CommonFrameworks.DotNet) 627public IEnumerable<KeyValuePair<NuGetFramework, NuGetFramework>> ShortNameReplacements 635private static readonly Lazy<KeyValuePair<NuGetFramework, NuGetFramework>[]> FullNameReplacementsLazy = new Lazy<KeyValuePair<NuGetFramework, NuGetFramework>[]>(() => 639new KeyValuePair<NuGetFramework, NuGetFramework>(FrameworkConstants.CommonFrameworks.DotNet, FrameworkConstants.CommonFrameworks.DotNet50) 643public IEnumerable<KeyValuePair<NuGetFramework, NuGetFramework>> FullNameReplacements
DefaultPortableFrameworkMappings.cs (32)
15private static readonly Lazy<KeyValuePair<int, NuGetFramework[]>[]> ProfileFrameworksLazy = new Lazy<KeyValuePair<int, NuGetFramework[]>[]>(() => 17var net4 = FrameworkConstants.CommonFrameworks.Net4; 18var net403 = FrameworkConstants.CommonFrameworks.Net403; 19var net45 = FrameworkConstants.CommonFrameworks.Net45; 20var net451 = FrameworkConstants.CommonFrameworks.Net451; 22var win8 = FrameworkConstants.CommonFrameworks.Win8; 23var win81 = FrameworkConstants.CommonFrameworks.Win81; 25var sl4 = FrameworkConstants.CommonFrameworks.SL4; 26var sl5 = FrameworkConstants.CommonFrameworks.SL5; 28var wp7 = FrameworkConstants.CommonFrameworks.WP7; 29var wp75 = FrameworkConstants.CommonFrameworks.WP75; 30var wp8 = FrameworkConstants.CommonFrameworks.WP8; 31var wp81 = FrameworkConstants.CommonFrameworks.WP81; 33var wpa81 = FrameworkConstants.CommonFrameworks.WPA81; 89public IEnumerable<KeyValuePair<int, NuGetFramework[]>> ProfileFrameworks 97private static KeyValuePair<int, NuGetFramework[]> CreateProfileFrameworks(int profile, params NuGetFramework[] frameworks) 99return new KeyValuePair<int, NuGetFramework[]>(profile, frameworks); 108private static readonly Lazy<List<KeyValuePair<int, NuGetFramework[]>>> ProfileOptionalFrameworksLazy = new Lazy<List<KeyValuePair<int, NuGetFramework[]>>>(() => 110var monoandroid = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.MonoAndroid, new Version(0, 0)); 111var monotouch = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.MonoTouch, new Version(0, 0)); 112var xamarinIOs = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinIOs, new Version(0, 0)); 113var xamarinMac = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinMac, new Version(0, 0)); 114var xamarinTVOS = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinTVOS, new Version(0, 0)); 115var xamarinWatchOS = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinWatchOS, new Version(0, 0)); 116var monoFrameworks = new NuGetFramework[] { monoandroid, monotouch, xamarinIOs, xamarinMac, xamarinWatchOS, xamarinTVOS }; 118var profileOptionalFrameworks = new List<KeyValuePair<int, NuGetFramework[]>>(ProfilesWithOptionalFrameworks.Length); 122profileOptionalFrameworks.Add(new KeyValuePair<int, NuGetFramework[]>(profile, monoFrameworks)); 128public IEnumerable<KeyValuePair<int, NuGetFramework[]>> ProfileOptionalFrameworks 164NuGetFramework netStandard)
DualCompatibilityFramework.cs (7)
19public NuGetFramework RootFramework { get; } 24public NuGetFramework SecondaryFramework { get; } 35public DualCompatibilityFramework(NuGetFramework framework, NuGetFramework secondaryFramework) 54_fallbackFramework = new FallbackFramework(RootFramework, new NuGetFramework[] { SecondaryFramework }); 60private static NuGetFramework ValidateFrameworkArgument(NuGetFramework framework)
FallbackFramework.cs (4)
8using FallbackList = System.Collections.Generic.IReadOnlyList<NuGet.Frameworks.NuGetFramework>; 21public FallbackFramework(NuGetFramework framework, FallbackList fallbackFrameworks) 55foreach (var each in Fallback) 78return NuGetFramework.Comparer.Equals(this, other)
FrameworkConstants.cs (79)
80public static readonly NuGetFramework Net11 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(1, 1, 0, 0)); 82public static readonly NuGetFramework Net2 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(2, 0, 0, 0)); 84public static readonly NuGetFramework Net35 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(3, 5, 0, 0)); 86public static readonly NuGetFramework Net4 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 0, 0, 0)); 88public static readonly NuGetFramework Net403 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 0, 3, 0)); 90public static readonly NuGetFramework Net45 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 5, 0, 0)); 92public static readonly NuGetFramework Net451 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 5, 1, 0)); 94public static readonly NuGetFramework Net452 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 5, 2, 0)); 96public static readonly NuGetFramework Net46 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 0, 0)); 98public static readonly NuGetFramework Net461 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 1, 0)); 100public static readonly NuGetFramework Net462 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 2, 0)); 102public static readonly NuGetFramework Net463 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 6, 3, 0)); 104public static readonly NuGetFramework Net47 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 7, 0, 0)); 106public static readonly NuGetFramework Net471 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 7, 1, 0)); 108public static readonly NuGetFramework Net472 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 7, 2, 0)); 110public static readonly NuGetFramework Net48 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 8, 0, 0)); 112public static readonly NuGetFramework Net481 = new NuGetFramework(FrameworkIdentifiers.Net, new Version(4, 8, 1, 0)); 116public static readonly NuGetFramework NetCore45 = new NuGetFramework(FrameworkIdentifiers.NetCore, new Version(4, 5, 0, 0)); 119public static readonly NuGetFramework NetCore451 = new NuGetFramework(FrameworkIdentifiers.NetCore, new Version(4, 5, 1, 0)); 122public static readonly NuGetFramework NetCore50 = new NuGetFramework(FrameworkIdentifiers.NetCore, new Version(5, 0, 0, 0)); 124public static readonly NuGetFramework Win8 = new NuGetFramework(FrameworkIdentifiers.Windows, new Version(8, 0, 0, 0)); 125public static readonly NuGetFramework Win81 = new NuGetFramework(FrameworkIdentifiers.Windows, new Version(8, 1, 0, 0)); 126public static readonly NuGetFramework Win10 = new NuGetFramework(FrameworkIdentifiers.Windows, new Version(10, 0, 0, 0)); 128public static readonly NuGetFramework SL4 = new NuGetFramework(FrameworkIdentifiers.Silverlight, new Version(4, 0, 0, 0)); 129public static readonly NuGetFramework SL5 = new NuGetFramework(FrameworkIdentifiers.Silverlight, new Version(5, 0, 0, 0)); 131public static readonly NuGetFramework WP7 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(7, 0, 0, 0)); 132public static readonly NuGetFramework WP75 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(7, 5, 0, 0)); 133public static readonly NuGetFramework WP8 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(8, 0, 0, 0)); 134public static readonly NuGetFramework WP81 = new NuGetFramework(FrameworkIdentifiers.WindowsPhone, new Version(8, 1, 0, 0)); 135public static readonly NuGetFramework WPA81 = new NuGetFramework(FrameworkIdentifiers.WindowsPhoneApp, new Version(8, 1, 0, 0)); 137public static readonly NuGetFramework Tizen3 = new NuGetFramework(FrameworkIdentifiers.Tizen, new Version(3, 0, 0, 0)); 138public static readonly NuGetFramework Tizen4 = new NuGetFramework(FrameworkIdentifiers.Tizen, new Version(4, 0, 0, 0)); 139public static readonly NuGetFramework Tizen6 = new NuGetFramework(FrameworkIdentifiers.Tizen, new Version(6, 0, 0, 0)); 141public static readonly NuGetFramework AspNet = new NuGetFramework(FrameworkIdentifiers.AspNet, EmptyVersion); 142public static readonly NuGetFramework AspNetCore = new NuGetFramework(FrameworkIdentifiers.AspNetCore, EmptyVersion); 143public static readonly NuGetFramework AspNet50 = new NuGetFramework(FrameworkIdentifiers.AspNet, Version5); 144public static readonly NuGetFramework AspNetCore50 = new NuGetFramework(FrameworkIdentifiers.AspNetCore, Version5); 146public static readonly NuGetFramework Dnx = new NuGetFramework(FrameworkIdentifiers.Dnx, EmptyVersion); 147public static readonly NuGetFramework Dnx45 = new NuGetFramework(FrameworkIdentifiers.Dnx, new Version(4, 5, 0, 0)); 148public static readonly NuGetFramework Dnx451 = new NuGetFramework(FrameworkIdentifiers.Dnx, new Version(4, 5, 1, 0)); 149public static readonly NuGetFramework Dnx452 = new NuGetFramework(FrameworkIdentifiers.Dnx, new Version(4, 5, 2, 0)); 150public static readonly NuGetFramework DnxCore = new NuGetFramework(FrameworkIdentifiers.DnxCore, EmptyVersion); 151public static readonly NuGetFramework DnxCore50 = new NuGetFramework(FrameworkIdentifiers.DnxCore, Version5); 153public static readonly NuGetFramework DotNet 155public static readonly NuGetFramework DotNet50 157public static readonly NuGetFramework DotNet51 159public static readonly NuGetFramework DotNet52 161public static readonly NuGetFramework DotNet53 163public static readonly NuGetFramework DotNet54 165public static readonly NuGetFramework DotNet55 167public static readonly NuGetFramework DotNet56 170public static readonly NuGetFramework NetStandard 173public static readonly NuGetFramework NetStandard10 176public static readonly NuGetFramework NetStandard11 179public static readonly NuGetFramework NetStandard12 182public static readonly NuGetFramework NetStandard13 185public static readonly NuGetFramework NetStandard14 188public static readonly NuGetFramework NetStandard15 191public static readonly NuGetFramework NetStandard16 194public static readonly NuGetFramework NetStandard17 197public static readonly NuGetFramework NetStandard20 200public static readonly NuGetFramework NetStandard21 203public static readonly NuGetFramework NetStandardApp15 206public static readonly NuGetFramework UAP10 210public static readonly NuGetFramework NetCoreApp10 213public static readonly NuGetFramework NetCoreApp11 216public static readonly NuGetFramework NetCoreApp20 219public static readonly NuGetFramework NetCoreApp21 222public static readonly NuGetFramework NetCoreApp22 225public static readonly NuGetFramework NetCoreApp30 228public static readonly NuGetFramework NetCoreApp31 233public static readonly NuGetFramework Net50 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version5); 235public static readonly NuGetFramework Net60 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version6); 237public static readonly NuGetFramework Net70 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7); 239public static readonly NuGetFramework Net80 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version8); 241public static readonly NuGetFramework Net90 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version9); 243public static readonly NuGetFramework Net10_0 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version10); 245public static readonly NuGetFramework Net11_0 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version11); 247public static readonly NuGetFramework Native = new NuGetFramework(FrameworkIdentifiers.Native, new Version(0, 0, 0, 0));
FrameworkExpander.cs (11)
29public IEnumerable<NuGetFramework> Expand(NuGetFramework framework) 33var seen = new HashSet<NuGetFramework>() { framework }; 34var toExpand = new Stack<NuGetFramework>(); 39foreach (var expansion in ExpandInternal(toExpand.Pop())) 76private IEnumerable<NuGetFramework> ExpandInternal(NuGetFramework framework) 79if (_mappings.TryGetEquivalentFrameworks(framework, out IEnumerable<NuGetFramework>? directlyEquivalent)) 81foreach (var eqFw in directlyEquivalent) 92if (_mappings.TryGetEquivalentFrameworks(frameworkRange, out IEnumerable<NuGetFramework>? equivalent)) 94foreach (var eqFw in equivalent)
FrameworkExtensions.cs (2)
14public static bool IsDesktop(this NuGetFramework framework) 24public static T? GetNearest<T>(this IEnumerable<T> items, NuGetFramework projectFramework) where T : class, IFrameworkSpecific
FrameworkNameProvider.cs (127)
16private static readonly HashSet<NuGetFramework> EmptyFrameworkSet = new(); 52private readonly Dictionary<int, HashSet<NuGetFramework>> _portableFrameworks; 53private readonly Dictionary<int, HashSet<NuGetFramework>> _portableOptionalFrameworks; 59private readonly Dictionary<NuGetFramework, HashSet<NuGetFramework>> _equivalentFrameworks; 80private readonly Dictionary<NuGetFramework, NuGetFramework> _shortNameRewrites; 81private readonly Dictionary<NuGetFramework, NuGetFramework> _fullNameRewrites; 84private readonly List<NuGetFramework> _netStandardVersions; 85private readonly List<NuGetFramework> _compatibleCandidates; 94_portableFrameworks = new Dictionary<int, HashSet<NuGetFramework>>(); 95_portableOptionalFrameworks = new Dictionary<int, HashSet<NuGetFramework>>(); 96_equivalentFrameworks = new Dictionary<NuGetFramework, HashSet<NuGetFramework>>(); 104_shortNameRewrites = new Dictionary<NuGetFramework, NuGetFramework>(); 105_fullNameRewrites = new Dictionary<NuGetFramework, NuGetFramework>(); 106_netStandardVersions = new List<NuGetFramework>(); 107_compatibleCandidates = new List<NuGetFramework>(); 282public bool TryGetPortableProfile(IEnumerable<NuGetFramework> supportedFrameworks, out int profileNumber) 294var reduced = new HashSet<NuGetFramework>(); 301foreach (var curFw in profileFrameworks) 305foreach (var optional in GetOptionalFrameworks(pair.Key)) 308if (NuGetFramework.FrameworkNameComparer.Equals(optional, curFw) 340private HashSet<NuGetFramework> RemoveDuplicateFramework(IEnumerable<NuGetFramework> supportedFrameworks) 342var result = new HashSet<NuGetFramework>(); 343var existingFrameworks = new HashSet<NuGetFramework>(); 345foreach (var framework in supportedFrameworks) 364private HashSet<NuGetFramework> GetAllEquivalentFrameworks(NuGetFramework framework) 368var toProcess = new Stack<NuGetFramework>(); 369var results = new HashSet<NuGetFramework>(); 376var current = toProcess.Pop(); 378if (_equivalentFrameworks.TryGetValue(current, out HashSet<NuGetFramework>? currentEquivalent)) 380foreach (var equalFramework in currentEquivalent) 395private IEnumerable<HashSet<NuGetFramework>> GetEquivalentPermutations(HashSet<NuGetFramework> frameworks) 399NuGetFramework? current = null; 400var remaining = frameworks.Count == 1 ? null : new HashSet<NuGetFramework>(); 403foreach (var fw in frameworks) 415HashSet<NuGetFramework> equalFrameworks; 418if (_equivalentFrameworks.TryGetValue(current!, out HashSet<NuGetFramework>? curFrameworks)) 420equalFrameworks = new HashSet<NuGetFramework>(curFrameworks); 424equalFrameworks = new HashSet<NuGetFramework>(); 430foreach (var fw in equalFrameworks) 443var singleFramework = new HashSet<NuGetFramework>(); 453private HashSet<NuGetFramework> GetOptionalFrameworks(int profile) 455if (_portableOptionalFrameworks.TryGetValue(profile, out HashSet<NuGetFramework>? frameworks)) 463public bool TryGetPortableFrameworks(int profile, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks) 468public bool TryGetPortableFrameworks(int profile, bool includeOptional, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks) 470var result = new HashSet<NuGetFramework>(); 471if (_portableFrameworks.TryGetValue(profile, out HashSet<NuGetFramework>? tmpFrameworks)) 473foreach (var fw in tmpFrameworks) 481if (_portableOptionalFrameworks.TryGetValue(profile, out HashSet<NuGetFramework>? optional)) 483foreach (var fw in optional) 494public bool TryGetPortableFrameworks(string shortPortableProfiles, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks) 503var result = new List<NuGetFramework>(shortNames.Length); 506var framework = NuGetFramework.Parse(name, this); 549public bool TryGetPortableFrameworks(string profile, bool includeOptional, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks) 560frameworks = Enumerable.Empty<NuGetFramework>(); 568public bool TryGetEquivalentFrameworks(NuGetFramework framework, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks) 570var result = new HashSet<NuGetFramework>(); 573if (_equivalentFrameworks.TryGetValue(framework, out HashSet<NuGetFramework>? eqFrameworks)) 575foreach (var eqFw in eqFrameworks) 581var baseFrameworks = new List<NuGetFramework>(result); 585foreach (var fw in baseFrameworks) 606public bool TryGetEquivalentFrameworks(FrameworkRange range, [NotNullWhen(true)] out IEnumerable<NuGetFramework>? frameworks) 613var relevant = new HashSet<NuGetFramework>(); 615foreach (var framework in _equivalentFrameworks.Keys.Where(f => range.Satisfies(f))) 620var results = new HashSet<NuGetFramework>(); 622foreach (var framework in relevant) 624if (TryGetEquivalentFrameworks(framework, out IEnumerable<NuGetFramework>? values)) 626foreach (var val in values) 703private void AddShortNameRewriteMappings(IEnumerable<KeyValuePair<NuGetFramework, NuGetFramework>> mappings) 717private void AddFullNameRewriteMappings(IEnumerable<KeyValuePair<NuGetFramework, NuGetFramework>> mappings) 807private void AddEquivalentFrameworks(IEnumerable<KeyValuePair<NuGetFramework, NuGetFramework>> mappings) 813var remaining = new Stack<NuGetFramework>(); 817var seen = new HashSet<NuGetFramework>(); 820var next = remaining.Pop(); 826if (!_equivalentFrameworks.TryGetValue(next, out HashSet<NuGetFramework>? eqFrameworks)) 829eqFrameworks = new HashSet<NuGetFramework>(); 835foreach (var framework in eqFrameworks) 843foreach (var framework in seen) 845foreach (var other in seen) 847if (!NuGetFramework.Comparer.Equals(framework, other)) 906private void AddPortableProfileMappings(IEnumerable<KeyValuePair<int, NuGetFramework[]>> mappings) 912if (!_portableFrameworks.TryGetValue(pair.Key, out HashSet<NuGetFramework>? frameworks)) 914frameworks = new HashSet<NuGetFramework>(); 918foreach (var fw in pair.Value) 927private void AddPortableOptionalFrameworks(IEnumerable<KeyValuePair<int, NuGetFramework[]>> mappings) 933if (!_portableOptionalFrameworks.TryGetValue(pair.Key, out HashSet<NuGetFramework>? frameworks)) 935frameworks = new HashSet<NuGetFramework>(); 939foreach (var fw in pair.Value) 979public bool TryGetCompatibilityMappings(NuGetFramework framework, [NotNullWhen(true)] out IEnumerable<FrameworkRange>? supportedFrameworkRanges) 1003public int CompareFrameworks(NuGetFramework? x, NuGetFramework? y) 1024public int CompareEquivalentFrameworks(NuGetFramework? x, NuGetFramework? y) 1029private static int CompareUsingPrecedence(NuGetFramework? x, NuGetFramework? y, Dictionary<string, int> precedence) 1056public NuGetFramework GetShortNameReplacement(NuGetFramework framework) 1059if (!_shortNameRewrites.TryGetValue(framework, out NuGetFramework? result)) 1067public NuGetFramework GetFullNameReplacement(NuGetFramework framework) 1070if (!_fullNameRewrites.TryGetValue(framework, out NuGetFramework? result)) 1078public IEnumerable<NuGetFramework> GetNetStandardVersions() 1083public IEnumerable<NuGetFramework> GetCompatibleCandidates() 1090foreach (var framework in _compatibleCandidates) 1103var set = new HashSet<NuGetFramework>(); 1106foreach (var framework in _equivalentFrameworks.Values.SelectMany(x => x)) 1123var portable = new NuGetFramework( 1142foreach (var framework in set.ToArray()) 1171private static bool SetEquals(HashSet<NuGetFramework> left, HashSet<NuGetFramework> right) 1178foreach (var fw in left) 1189private static void UnionWith(HashSet<NuGetFramework> toAccumulate, HashSet<NuGetFramework> toAdd) 1191foreach (var fw in toAdd)
FrameworkRange.cs (9)
17public FrameworkRange(NuGetFramework min, NuGetFramework max) 23public FrameworkRange(NuGetFramework min, NuGetFramework max, bool includeMin, bool includeMax) 42public NuGetFramework Min { get; } 47public NuGetFramework Max { get; } 79public bool Satisfies(NuGetFramework framework) 86private static bool SameExceptForVersion(NuGetFramework x, NuGetFramework y)
FrameworkReducer.cs (66)
42public NuGetFramework? GetNearest(NuGetFramework framework, IEnumerable<NuGetFramework> possibleFrameworks) 47var nearest = GetNearestInternal(framework, possibleFrameworks); 55foreach (var supportFramework in fallbackFramework.Fallback) 69private NuGetFramework? GetNearestInternal(NuGetFramework framework, IEnumerable<NuGetFramework> possibleFrameworks) 71NuGetFramework? nearest = null; 74if (possibleFrameworks.Any(e => e != NuGetFramework.UnsupportedFramework)) 76possibleFrameworks = possibleFrameworks.Where(e => e != NuGetFramework.UnsupportedFramework); 136reduced = new NuGetFramework[] { GetBestPCL(reduced)! }; 198NuGetFramework first = f.First(); 231public IEnumerable<NuGetFramework> ReduceEquivalent(IEnumerable<NuGetFramework> frameworks) 241var duplicates = new HashSet<NuGetFramework>(); 242foreach (var framework in input) 253if (_mappings.TryGetEquivalentFrameworks(framework, out IEnumerable<NuGetFramework>? eqFrameworks)) 255foreach (var eqFramework in eqFrameworks) 267public IEnumerable<NuGetFramework> ReduceUpwards(IEnumerable<NuGetFramework> frameworks) 272if (frameworks.Any(e => e != NuGetFramework.AnyFramework)) 275frameworks = frameworks.Where(e => e != NuGetFramework.AnyFramework); 287public IEnumerable<NuGetFramework> ReduceDownwards(IEnumerable<NuGetFramework> frameworks) 292if (frameworks.Any(e => e == NuGetFramework.AnyFramework)) 295return new[] { NuGetFramework.AnyFramework }; 301private IEnumerable<NuGetFramework> ReduceCore(IEnumerable<NuGetFramework> frameworks, Func<NuGetFramework, NuGetFramework, bool> isCompat) 306var results = new List<NuGetFramework>(input.Length); 312var x = input[i]; 318var y = input[j]; 351private IEnumerable<NuGetFramework> GetNearestNonPCLtoPCL(NuGetFramework framework, IEnumerable<NuGetFramework> reduced) 360var nearestProfileFramework = GetNearest(framework, allPclFrameworks); 370private IEnumerable<NuGetFramework> GetNearestPCLtoPCL(NuGetFramework framework, IEnumerable<NuGetFramework> reduced) 385var scores = new Dictionary<NuGetFramework, int>(); 388foreach (var sub in subFrameworks) 393var nearestForSub = GetNearest(sub, allPclFrameworks); 398foreach (KeyValuePair<NuGetFramework, IEnumerable<NuGetFramework>> pair in pclToFrameworks) 424private Dictionary<NuGetFramework, IEnumerable<NuGetFramework>> ExplodePortableFrameworks(IEnumerable<NuGetFramework> pcls) 426var result = new Dictionary<NuGetFramework, IEnumerable<NuGetFramework>>(); 428foreach (var pcl in pcls) 440private IEnumerable<NuGetFramework> ExplodePortableFramework(NuGetFramework pcl, bool includeOptional = true) 442if (!_mappings.TryGetPortableFrameworks(pcl.Profile, includeOptional, out IEnumerable<NuGetFramework>? frameworks)) 445frameworks = Enumerable.Empty<NuGetFramework>(); 454private NuGetFramework? GetBestPCL(IEnumerable<NuGetFramework> reduced) 456NuGetFramework? current = null; 458foreach (var considering in reduced) 476private bool IsBetterPCL(NuGetFramework current, NuGetFramework considering) 509var consideringFramework = consideringFrameworks.First(f => StringComparer.OrdinalIgnoreCase.Equals(f.Framework, sharedId)); 510var currentFramework = currentFrameworks.First(f => StringComparer.OrdinalIgnoreCase.Equals(f.Framework, sharedId)); 533var consideringNet = consideringFrameworks.FirstOrDefault(f => StringComparer.OrdinalIgnoreCase.Equals(f.Framework, FrameworkConstants.FrameworkIdentifiers.Net)); 534var currentNet = currentFrameworks.FirstOrDefault(f => StringComparer.OrdinalIgnoreCase.Equals(f.Framework, FrameworkConstants.FrameworkIdentifiers.Net));
FrameworkRuntimePair.cs (3)
15public NuGetFramework Framework { get; } 21public FrameworkRuntimePair(NuGetFramework framework, string? runtimeIdentifier) 66public static string GetTargetGraphName(NuGetFramework framework, string? runtimeIdentifier)
NuGetFramework.cs (15)
15public partial class NuGetFramework : IEquatable<NuGetFramework> 24public NuGetFramework(NuGetFramework framework) 138var framework = mappings.GetFullNameReplacement(this); 199var framework = mappings.GetShortNameReplacement(this); 237&& mappings.TryGetPortableFrameworks(framework.Profile, includeOptional: false, out IEnumerable<NuGetFramework>? frameworks) 240var required = new HashSet<NuGetFramework>(frameworks, Comparer); 409public static readonly IEqualityComparer<NuGetFramework> Comparer = NuGetFrameworkFullComparer.Instance; 414public static readonly IEqualityComparer<NuGetFramework> FrameworkNameComparer = NuGetFrameworkNameComparer.Instance; 423public bool Equals(NuGetFramework? other) 431public static bool operator ==(NuGetFramework? left, NuGetFramework? right) 439public static bool operator !=(NuGetFramework? left, NuGetFramework? right) 456var other = obj as NuGetFramework;
NuGetFrameworkFactory.cs (20)
18public static readonly NuGetFramework UnsupportedFramework = new NuGetFramework(FrameworkConstants.SpecialIdentifiers.Unsupported); 23public static readonly NuGetFramework AgnosticFramework = new NuGetFramework(FrameworkConstants.SpecialIdentifiers.Agnostic); 28public static readonly NuGetFramework AnyFramework = new NuGetFramework(FrameworkConstants.SpecialIdentifiers.Any); 33public static NuGetFramework Parse(string folderName) 41public static NuGetFramework Parse(string folderName, IFrameworkNameProvider mappings) 48NuGetFramework framework = folderName.IndexOf(',') > -1 58public static NuGetFramework ParseComponents(string targetFrameworkMoniker, string? targetPlatformMoniker) 73internal static NuGetFramework ParseComponents(string targetFrameworkMoniker, string? targetPlatformMoniker, IFrameworkNameProvider mappings) 78NuGetFramework? result; 99if (profile != null && mappings.TryGetPortableFrameworks(profile, out IEnumerable<NuGetFramework>? clientFrameworks)) 149public static NuGetFramework ParseFrameworkName(string frameworkName, IFrameworkNameProvider mappings) 157if (!TryParseSpecialFramework(parts[0], out NuGetFramework? result)) 246public static NuGetFramework ParseFolder(string folderName) 254public static NuGetFramework ParseFolder(string folderName, IFrameworkNameProvider mappings) 271NuGetFramework? result; 338if (!mappings.TryGetPortableFrameworks(profileShort!, out IEnumerable<NuGetFramework>? clientFrameworks)) 367if (TryParseDeprecatedFramework(folderName, out NuGetFramework? deprecated)) 381private static bool TryParseDeprecatedFramework(string s, [NotNullWhen(true)] out NuGetFramework? framework) 508private static bool TryParseSpecialFramework(string frameworkString, [NotNullWhen(true)] out NuGetFramework? framework) 533private static bool TryParseCommonFramework(string frameworkString, [NotNullWhen(true)] out NuGetFramework? framework)
NuGetFrameworkUtility.cs (14)
18public static T? GetNearest<T>(IEnumerable<T> items, NuGetFramework framework, Func<T, NuGetFramework> selector) where T : class 31NuGetFramework framework, 34Func<T, NuGetFramework> selector) where T : class 44var mostCompatibleFramework = reducer.GetNearest(framework, items.Select(selector)); 47return items.FirstOrDefault(item => NuGetFramework.Comparer.Equals(selector(item), mostCompatibleFramework)); 59public static T? GetNearest<T>(IEnumerable<T> items, NuGetFramework framework) where T : IFrameworkSpecific 70NuGetFramework framework, 82var mostCompatibleFramework = reducer.GetNearest(framework, items.Select(item => item.TargetFramework)); 85return items.FirstOrDefault(item => NuGetFramework.Comparer.Equals(item.TargetFramework, mostCompatibleFramework)); 95public static bool IsCompatibleWithFallbackCheck(NuGetFramework projectFramework, NuGetFramework candidate) 108foreach (var supportFramework in fallbackFramework.Fallback) 126public static bool IsNetCore50AndUp(NuGetFramework framework)
NuGet.LibraryModel (4)
LibraryDependencyInfo.cs (4)
32public NuGetFramework Framework { get; } 37NuGetFramework framework, 49public static LibraryDependencyInfo CreateUnresolved(LibraryIdentity library, NuGetFramework framework) 57public static LibraryDependencyInfo Create(LibraryIdentity library, NuGetFramework framework, IEnumerable<LibraryDependency> dependencies)
NuGet.PackageManagement (71)
BuildIntegratedPackageReference.cs (2)
29public BuildIntegratedPackageReference(LibraryDependency dependency, NuGetFramework projectFramework) 50public BuildIntegratedPackageReference(LibraryDependency dependency, NuGetFramework projectFramework, PackageIdentity installedVersion)
NuGetPackageManager.cs (22)
834if (!nuGetProject.TryGetMetadata(NuGetProjectMetadataKeys.TargetFramework, out NuGetFramework framework)) 837framework = NuGetFramework.AnyFramework; 1107var targetFramework = nuGetProject.GetMetadata<NuGetFramework>(NuGetProjectMetadataKeys.TargetFramework); 1349var targetFramework = nuGetProject.GetMetadata<NuGetFramework>(NuGetProjectMetadataKeys.TargetFramework); 1366var targetFramework = nuGetProject.GetMetadata<NuGetFramework>(NuGetProjectMetadataKeys.TargetFramework); 1841var targetFramework = nuGetProject.GetMetadata<NuGetFramework>(NuGetProjectMetadataKeys.TargetFramework); 2371var packageReferenceTargetFramework = packageReference.TargetFramework; 2394NuGetFramework nuGetFramework, 3769NuGetFramework framework, 3792NuGetFramework framework; 3793if (!project.TryGetMetadata<NuGetFramework>(NuGetProjectMetadataKeys.TargetFramework, out framework)) 3796framework = NuGetFramework.AnyFramework; 3816NuGetFramework framework; 3817if (!project.TryGetMetadata<NuGetFramework>(NuGetProjectMetadataKeys.TargetFramework, out framework)) 3820framework = NuGetFramework.AnyFramework; 3828NuGetFramework framework, 3850NuGetFramework framework, 3875NuGetFramework framework,
Projects\DefaultProjectServices.cs (1)
47NuGetFramework targetFramework,
Projects\FolderNuGetProject.cs (3)
34private readonly NuGetFramework _framework; 55: this(root, packagePathResolver, NuGetFramework.AnyFramework) 68public FolderNuGetProject(string root, PackagePathResolver packagePathResolver, NuGetFramework targetFramework)
Projects\IMSBuildProjectSystem.cs (1)
15NuGetFramework TargetFramework { get; }
Projects\IProjectSystemReferencesReader.cs (1)
31NuGetFramework targetFramework,
Projects\MSBuildNuGetProject.cs (2)
379var anyFrameworkToolsGroup = toolItemGroups.FirstOrDefault(g => g.TargetFramework.Equals(NuGetFramework.AnyFramework)); 441var packageTargetFramework = packageReference.TargetFramework ?? ProjectSystem.TargetFramework;
Projects\PackagesConfigNuGetProject.cs (3)
55private NuGetFramework TargetFramework { get; } 73? NuGetFramework.ParseFrameworkName((string)oFramework, DefaultFrameworkNameProvider.Instance) 74: (NuGetFramework)oFramework;
Projects\ProjectJsonNuGetProject.cs (9)
70var targetFrameworks = Enumerable.Empty<NuGetFramework>(); 83var targetFramework = NuGetFramework.UnsupportedFramework; 199var nuGetFramework = targetFramework as NuGetFramework; 230foreach (var framework in packageSpec.TargetFrameworks.Select(e => e.FrameworkName)) 304protected bool IsUAPFramework(NuGetFramework framework) 367var newTargetFramework = newTargetFrameworkObject as NuGetFramework;
Resolution\GatherCache.cs (8)
37NuGetFramework framework, 51NuGetFramework framework, 65NuGetFramework framework) 107NuGetFramework framework) 126NuGetFramework framework) 133public NuGetFramework Framework { get; } 181NuGetFramework framework) 188public NuGetFramework Framework { get; set; }
Resolution\GatherContext.cs (1)
31public NuGetFramework TargetFramework { get; set; }
Resolution\ResolverGather.cs (1)
490NuGetFramework targetFramework,
Utility\JsonConfigUtility.cs (6)
143public static IEnumerable<NuGetFramework> GetFrameworks(JObject json) 145var results = new List<NuGetFramework>(); 156results.Add(NuGetFramework.Parse(frameworkProperty.Name)); 167public static void AddFramework(JObject json, NuGetFramework framework) 222private static bool HasFramework(IEnumerable<NuGetFramework> list, NuGetFramework framework)
Utility\MSBuildNuGetProjectSystemUtility.cs (8)
43public static FrameworkSpecificGroup GetMostCompatibleGroup(NuGetFramework projectTargetFramework, 47var mostCompatibleFramework 96|| !frameworkSpecificGroup.TargetFramework.Equals(NuGetFramework.AnyFramework)); 145var packageTargetFramework = frameworkSpecificGroup.TargetFramework; 221var packageTargetFramework = frameworkSpecificGroup.TargetFramework; 274var projectFramework = projectSystem.TargetFramework; 582private static string GetEffectivePathForContentFile(NuGetFramework nuGetFramework, string zipArchiveEntryFullName) 590if (!nuGetFramework.Equals(NuGetFramework.AnyFramework))
Utility\PackageGraphAnalysisUtilities.cs (1)
33NuGetFramework nuGetFramework,
Utility\PackagesConfigLockFileUtility.cs (2)
90NuGetFramework projectTfm, 283NuGetFramework projectTfm,
NuGet.Packaging (138)
ContentModel\AnyFramework.cs (1)
18: base(NuGetFramework.AnyFramework)
ContentModel\ManagedCodeConventions.cs (20)
71private Dictionary<ReadOnlyMemory<char>, NuGetFramework> _frameworkCache = new(ReadOnlyMemoryCharComparerOrdinal.Instance); 229if (!_frameworkCache.TryGetValue(name, out NuGetFramework? cachedResult)) 243private static NuGetFramework TargetFrameworkName_ParserCore(string name) 245var result = NuGetFramework.ParseFolder(name); 254result = NuGetFramework.ParseFrameworkName(name, DefaultFrameworkNameProvider.Instance); 301var criteriaFrameworkName = criteria as NuGetFramework; 302var availableFrameworkName = available as NuGetFramework; 334var projectFrameworkName = projectFramework as NuGetFramework; 335var criteriaFrameworkName = criteria as NuGetFramework; 336var availableFrameworkName = available as NuGetFramework; 345var frameworks = new NuGetFramework[] { criteriaFrameworkName, availableFrameworkName }; 348var nearest = FrameworkReducer.GetNearest(projectFrameworkName, frameworks); 374public SelectionCriteria ForFrameworkAndRuntime(NuGetFramework framework, string? runtimeIdentifier) 399public SelectionCriteria ForFramework(NuGetFramework framework)
Core\ContentExtractor.cs (2)
18internal static IEnumerable<NuGetFramework> GetGroupFrameworks(IEnumerable<ContentItemGroup> groups) 20return groups.Select(e => ((NuGetFramework)e.Properties["tfm"]));
Core\FrameworkNameValidatorUtility.cs (3)
9internal static bool IsValidFrameworkName(NuGetFramework framework) 17NuGetFramework? fx; 29return fx != null && fx.Framework != NuGetFramework.UnsupportedFramework.Framework;
Core\FrameworkReferenceGroup.cs (2)
21public FrameworkReferenceGroup(NuGetFramework targetFramework, IEnumerable<FrameworkReference> frameworkReferences) 30public NuGetFramework TargetFramework { get; }
Core\FrameworkSpecificGroup.cs (3)
18private readonly NuGetFramework _targetFramework; 26public FrameworkSpecificGroup(NuGetFramework targetFramework, IEnumerable<string> items) 52public NuGetFramework TargetFramework
Core\NuspecUtility.cs (2)
168var framework = NuGetFramework.Parse(groupFramework!, frameworkProvider);
Core\PackageDependencyGroup.cs (6)
19private readonly NuGetFramework _targetFramework; 23private PackageDependencyGroup(NuGetFramework? targetFramework) 27_targetFramework = NuGetFramework.AnyFramework; 42public PackageDependencyGroup(NuGetFramework targetFramework, IEnumerable<PackageDependency> packages) 62public NuGetFramework TargetFramework 93return EqualityComparer<NuGetFramework>.Default.Equals(TargetFramework, other.TargetFramework)
NuspecReader.cs (14)
141var framework = string.IsNullOrEmpty(groupFramework) 142? NuGetFramework.AnyFramework 143: NuGetFramework.Parse(groupFramework!, _frameworkProvider); 158yield return new PackageDependencyGroup(NuGetFramework.AnyFramework, packages); 180var framework = string.IsNullOrEmpty(groupFramework) ? NuGetFramework.AnyFramework : NuGetFramework.Parse(groupFramework!, _frameworkProvider); 193yield return new FrameworkSpecificGroup(NuGetFramework.AnyFramework, items); 218var groups = new Dictionary<NuGetFramework, HashSet<string>>(NuGetFrameworkFullComparer.Instance); 224var frameworks = new List<NuGetFramework>(); 229frameworks.Add(NuGetFramework.AnyFramework); 237frameworks.Add(NuGetFramework.Parse(fwString.Trim(), _frameworkProvider)); 243foreach (var framework in frameworks) 258foreach ((var framework, var items) in groups.OrderBy(e => e.Key, NuGetFrameworkSorter.Instance))
PackageCreation\Authoring\FrameworkAssemblyReference.cs (2)
12public FrameworkAssemblyReference(string assemblyName, IEnumerable<NuGetFramework> supportedFrameworks) 29public IEnumerable<NuGetFramework> SupportedFrameworks { get; private set; }
PackageCreation\Authoring\IPackageFile.cs (1)
48NuGetFramework? NuGetFramework
PackageCreation\Authoring\ManifestReader.cs (6)
327new[] { NuGetFramework.AnyFramework } : 328new[] { NuGetFramework.Parse(element.GetOptionalAttributeValue("targetFramework")!.Trim()) }) 351var dependencyGroup = new PackageDependencyGroup(NuGetFramework.AnyFramework, dependencies); 361NuGetFramework? targetFramework = null; 365targetFramework = NuGetFramework.Parse(targetFrameworkName); 374targetFramework = targetFramework ?? NuGetFramework.UnsupportedFramework;
PackageCreation\Authoring\PackageBuilder.cs (4)
155TargetFrameworks = new List<NuGetFramework>(); 293public IList<NuGetFramework> TargetFrameworks { get; set; } 759var framework = (NuGetFramework)item.Properties["tfm"];
PackageCreation\Authoring\PackageReferenceSet.cs (4)
20: this((NuGetFramework?)null, references) 30: this(targetFramework != null ? NuGetFramework.Parse(targetFramework) : null, references) 39public PackageReferenceSet(NuGetFramework? targetFramework, IEnumerable<string> references) 52public NuGetFramework? TargetFramework { get; }
PackageCreation\Authoring\PhysicalPackageFile.cs (1)
73public NuGetFramework? NuGetFramework { get; private set; }
PackageCreation\Extensions\FrameworksExtensions.cs (1)
14public static string GetFrameworkString(this NuGetFramework self)
PackageCreation\Utility\FrameworkNameUtility.cs (6)
73var nugetFramework = NuGetFramework.ParseFolder(targetFrameworkString); 85public static NuGetFramework? ParseNuGetFrameworkFromFilePath(string filePath, out string effectivePath) 124public static NuGetFramework? ParseNuGetFrameworkFolderName(string path, bool strictParsing, out string effectivePath) 143var nugetFramework = NuGetFramework.ParseFolder(targetFrameworkString);
PackageReaderBase.cs (12)
267var fallbackGroup = referenceGroups.FirstOrDefault(g => g.TargetFramework.Equals(NuGetFramework.AnyFramework)); 366public virtual IEnumerable<NuGetFramework> GetSupportedFrameworks() 368var frameworks = new HashSet<NuGetFramework>(NuGetFrameworkFullComparer.Instance); 390public virtual Task<IEnumerable<NuGetFramework>> GetSupportedFrameworksAsync(CancellationToken cancellationToken) 427var groups = new Dictionary<NuGetFramework, List<string>>(NuGetFrameworkFullComparer.Instance); 433var framework = GetFrameworkFromPath(path, allowSubFolders); 446foreach ((var framework, var items) in groups.OrderBy(e => e.Key, NuGetFrameworkSorter.Instance)) 452protected NuGetFramework GetFrameworkFromPath(string path, bool allowSubFolders = false) 454var framework = NuGetFramework.AnyFramework; 464NuGetFramework parsedFramework; 467parsedFramework = NuGetFramework.ParseFolder(folderName, FrameworkProvider);
PackageReference.cs (5)
23public PackageReference(PackageIdentity identity, NuGetFramework targetFramework) 31public PackageReference(PackageIdentity identity, NuGetFramework targetFramework, bool userInstalled) 40NuGetFramework targetFramework, 57public PackageReference(PackageIdentity identity, NuGetFramework targetFramework, bool userInstalled, bool developmentDependency, bool requireReinstallation, VersionRange? allowedVersions) 90public NuGetFramework TargetFramework { get; }
PackagesConfigReader.cs (3)
189var targetFramework = NuGetFramework.UnsupportedFramework; 192targetFramework = NuGetFramework.Parse(attributeValue!, _frameworkMappings);
PackagesConfigWriter.cs (4)
143public void AddPackageEntry(string packageId, NuGetVersion version, NuGetFramework targetFramework) 166public void AddPackageEntry(PackageIdentity identity, NuGetFramework targetFramework) 297public void RemovePackageEntry(string packageId, NuGetVersion version, NuGetFramework targetFramework) 322public void RemovePackageEntry(PackageIdentity identity, NuGetFramework targetFramework)
Rules\AccidentallyCompatibleWithAllFrameworksRule.cs (1)
59foreach (var targetFramework in buildFrameworks)
Rules\DependenciesGroupsForEachTFMRule.cs (24)
21private static readonly NuGetFramework Net00 = NuGetFramework.Parse("net00"); 36internal IEnumerable<PackagingLogMessage> GenerateWarnings(HashSet<NuGetFramework> compatNotExactMatches, HashSet<NuGetFramework> noExactMatchesFromFile, HashSet<NuGetFramework> noExactMatchesFromNuspec) 60internal (HashSet<NuGetFramework>, HashSet<NuGetFramework>, HashSet<NuGetFramework>) Categorize(IEnumerable<string> files, IEnumerable<NuGetFramework> tfmsFromNuspec) 72var tfmsFromFilesSet = new HashSet<NuGetFramework>(); 78var noExactMatchesFromFile = new HashSet<NuGetFramework>(); 79var noExactMatchesFromNuspec = new HashSet<NuGetFramework>(); 80var compatNotExactMatches = new HashSet<NuGetFramework>(); 85foreach (var fileTFM in noExactMatchesFromFile) 87foreach (var nuspecTFM in noExactMatchesFromNuspec) 105internal (string noExactMatchString, string compatMatchString) GenerateWarningString(ICollection<NuGetFramework> noExactMatchesFromFile, 106ICollection<NuGetFramework> noExactMatchesFromNuspec, ICollection<NuGetFramework> compatNotExactMatches) 115foreach (var tfm in noExactMatchesFromFile) 143foreach (var tfm in noExactMatchesFromNuspec) 166foreach (var tfm in compatNotExactMatches) 188private static IEnumerable<NuGetFramework> ExtractTFMsFromNuspec(Stream packageNuspecStream) 195return nuspec.Descendants(XName.Get("{" + name.NamespaceName + "}dependencies")).Elements().Attributes("targetFramework").Select(f => NuGetFramework.Parse(f.Value)); 197return Array.Empty<NuGetFramework>();
Rules\InvalidPrereleaseDependencyRule.cs (1)
50private PackagingLogMessage CreatePackageIssueForPrereleaseDependency(PackageDependency dependency, NuGetFramework framework)
Rules\InvalidUndottedFrameworkRule.cs (2)
287var framework = NuGetFramework.Parse(frameworkString);
Rules\ReferencesInNuspecMatchRefAssetsRule.cs (4)
40nuspecReferences = targetFrameworks.ToDictionary(k => NuGetFramework.Parse(k.Value).GetShortFolderName(), 57.GroupBy(t => NuGetFramework.ParseFolder(t.Split('/')[1]).GetShortFolderName(), t => Path.GetFileName(t)); 60!NuGetFramework.ParseFolder(t).GetShortFolderName().Equals("unsupported", StringComparison.Ordinal) && 61!NuGetFramework.ParseFolder(t).GetShortFolderName().Equals("any", StringComparison.Ordinal));
Rules\UpholdBuildConventionRule.cs (2)
106var framework = NuGetFramework.ParseFolder(folderName);
RuntimeModel\JsonRuntimeFormat.cs (2)
181var framework = NuGetFramework.Parse(property.Key);
NuGet.ProjectModel (66)
CentralTransitiveDependencyGroup.cs (1)
14public CentralTransitiveDependencyGroup(NuGetFramework framework, IEnumerable<LibraryDependency> transitiveDependencies)
JsonPackageSpecReader.cs (7)
68private static void AddTargetFramework(PackageSpec packageSpec, NuGetFramework frameworkName, NuGetFramework secondaryFramework, TargetFrameworkInformation targetFrameworkInformation) 70NuGetFramework updatedFramework = frameworkName; 74NuGetFramework[] imports = targetFrameworkInformation.Imports.ToArray(); 94private static NuGetFramework GetDualCompatibilityFrameworkIfNeeded(NuGetFramework frameworkName, NuGetFramework secondaryFramework)
JsonPackageSpecReader.Utf8JsonStreamReader.cs (15)
568NuGetFramework framework = NuGetFramework.Parse(compatibilitySetName); 721private static void ReadImports(PackageSpec packageSpec, ref Utf8JsonStreamReader jsonReader, List<NuGetFramework> importFrameworks) 729NuGetFramework framework = NuGetFramework.Parse(import); 1396NuGetFramework framework = frameworkProperty == null ? NuGetFramework.Parse(key) : NuGetFramework.Parse(frameworkProperty); 1415NuGetFramework frameworkName = null; 1421List<NuGetFramework> imports = null; 1427NuGetFramework secondaryFramework = default; 1442secondaryFramework = NuGetFramework.Parse(secondaryFrameworkString); 1490frameworkName = NuGetFramework.Parse(frameworkProperty); 1494imports ??= new List<NuGetFramework>(); 1540frameworkName = NuGetFramework.Parse(key);
LockFile\LockFile.cs (2)
18public static readonly NuGetFramework ToolFramework = FrameworkConstants.CommonFrameworks.NetCoreApp10; 33public LockFileTarget GetTarget(NuGetFramework framework, string runtimeIdentifier)
LockFile\LockFileTarget.cs (2)
15public NuGetFramework TargetFramework { get; set; } 49if (NuGetFramework.Comparer.Equals(TargetFramework, other.TargetFramework)
LockFile\Utf8JsonStreamLockFileConverter.cs (2)
163NuGetFramework framework = NuGetFramework.Parse(frameworkPropertyName);
LockFile\Utf8JsonStreamLockFileTargetConverter.cs (1)
32lockFileTarget.TargetFramework = NuGetFramework.Parse(targetFramework);
PackageSpecExtensions.cs (7)
16public static TargetFrameworkInformation GetTargetFramework(this PackageSpec project, NuGetFramework targetFramework) 18var frameworkInfo = project.TargetFrameworks.FirstOrDefault(f => NuGetFramework.Comparer.Equals(targetFramework, f.FrameworkName)); 33public static ProjectRestoreMetadataFrameworkInfo GetRestoreMetadataFramework(this PackageSpec project, NuGetFramework targetFramework) 98public static TargetFrameworkInformation GetNearestTargetFramework(this PackageSpec project, NuGetFramework targetFramework, string? targetAlias) 114NuGetFramework? mostCompatibleFramework = reducer.GetNearest(targetFramework, project.TargetFrameworks.Select(e => e.FrameworkName)); 141static void FindMatchingFrameworks(PackageSpec project, NuGetFramework targetFramework, ref TargetFrameworkInformation? matchedFramework, ref List<TargetFrameworkInformation>? matchingFrameworks) 145if (NuGetFramework.Comparer.Equals(targetFramework, framework.FrameworkName))
PackageSpecOperations.cs (2)
120IEnumerable<NuGetFramework> frameworksToAdd) 201IEnumerable<NuGetFramework> frameworksToAdd)
PackageSpecReferenceDependencyProvider.cs (7)
98public Library GetLibrary(LibraryRange libraryRange, NuGetFramework targetFramework) 103public Library GetLibrary(LibraryRange libraryRange, NuGetFramework targetFramework, string alias) 190private static void AddLibraryProperties(Library library, PackageSpec packageSpec, NuGetFramework targetFramework, string alias) 211var frameworks = new List<NuGetFramework>( 236private List<LibraryDependency> GetDependenciesFromSpecRestoreMetadata(PackageSpec packageSpec, NuGetFramework targetFramework, string targetAlias) 304NuGetFramework targetFramework, 316NuGetFramework rootFramework = targetFramework is AssetTargetFallbackFramework atf
PackageSpecWriter.cs (3)
488private static void SetImports(IObjectWriter writer, ImmutableArray<NuGetFramework> frameworks) 554private static NuGetFramework DeconstructFallbackFrameworks(NuGetFramework nuGetFramework)
ProjectLockFile\PackagesLockFileFormat.cs (2)
206TargetFramework = NuGetFramework.Parse(parts[0]), 236TargetFramework = NuGetFramework.Parse(frameworkString),
ProjectLockFile\PackagesLockFileTarget.cs (3)
21public NuGetFramework TargetFramework { get; set; } 58&& NuGetFramework.Comparer.Equals(TargetFramework, other.TargetFramework) 79private static string GetNameString(NuGetFramework framework, string runtime, string alias)
ProjectLockFile\PackagesLockFileUtilities.cs (2)
106NuGetFramework[] lockFileFrameworks = nuGetLockFile.Targets 298static PackagesLockFileTarget GetTargetForTargetFrameworkInformation(PackagesLockFile nuGetLockFile, NuGetFramework framework, string targetAlias)
ProjectRestoreMetadataFrameworkInfo.cs (2)
22public NuGetFramework FrameworkName { get; set; } 33public ProjectRestoreMetadataFrameworkInfo(NuGetFramework frameworkName)
TargetFrameworkInformation.cs (5)
26private ImmutableArray<NuGetFramework> _imports; 31public required NuGetFramework FrameworkName { get; init; } 46public ImmutableArray<NuGetFramework> Imports 51_imports = value.IsDefault ? ImmutableArray<NuGetFramework>.Empty : value; 160hashCode.AddSequence((IReadOnlyList<NuGetFramework>)Imports);
ToolPathResolver.cs (3)
40public string GetLockFilePath(string packageId, NuGetVersion version, NuGetFramework framework) 48public string GetToolDirectoryPath(string packageId, NuGetVersion version, NuGetFramework framework) 83public string? GetBestToolDirectoryPath(string packageId, VersionRange versionRange, NuGetFramework framework)
NuGet.Protocol (41)
Converters\NuGetFrameworkConverter.cs (6)
10internal class NuGetFrameworkConverter : JsonConverter<NuGetFramework> 12public override void WriteJson(JsonWriter writer, NuGetFramework? value, JsonSerializer serializer) 17public override NuGetFramework ReadJson(JsonReader reader, Type objectType, NuGetFramework? existingValue, bool hasExistingValue, JsonSerializer serializer) 23return NuGetFramework.Parse(value!); 26return NuGetFramework.AnyFramework;
Converters\NuGetFrameworkStjConverter.cs (6)
13/// Used by: <see cref="NuGetFramework"/> properties. 15internal sealed class NuGetFrameworkStjConverter : JsonConverter<NuGetFramework> 18public override NuGetFramework Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 31return string.IsNullOrEmpty(value) ? NuGetFramework.AnyFramework : NuGetFramework.Parse(value!); 34public override void Write(Utf8JsonWriter writer, NuGetFramework value, JsonSerializerOptions options)
DependencyInfo\ResolverMetadataClient.cs (7)
84var currentFramework = GetFramework(dependencyGroupObj); 123NuGetFramework projectTargetFramework, 154var targetFramework = frameworkReducer.GetNearest(projectTargetFramework, depFrameworks); 184private static NuGetFramework GetFramework(JObject dependencyGroupObj) 186var framework = NuGetFramework.AnyFramework; 190framework = NuGetFramework.Parse(dependencyGroupObj["targetFramework"]!.ToString());
LegacyFeed\DependencyInfoResourceV2Feed.cs (4)
39NuGetFramework projectFramework, 67NuGetFramework projectFramework, 100NuGetFramework projectFramework) 109var nearestFramework = _frameworkReducer.GetNearest(
LegacyFeed\V2FeedPackageInfo.cs (4)
252var results = new Dictionary<NuGetFramework, List<PackageDependency>>(NuGetFrameworkFullComparer.Instance); 263var framework = NuGetFramework.AnyFramework; 286framework = NuGetFramework.Parse(frameworkString);
LegacyFeed\V2FeedQueryBuilder.cs (1)
71.Select(targetFramework => NuGetFramework.Parse(targetFramework).GetShortFolderName()));
LocalRepositories\LocalDependencyInfoResource.cs (3)
49NuGetFramework projectFramework, 96NuGetFramework projectFramework, 144private SourcePackageDependencyInfo CreateDependencyInfo(LocalPackageInfo package, NuGetFramework projectFramework)
Plugins\PluginPackageReader.cs (6)
507public override IEnumerable<NuGetFramework> GetSupportedFrameworks() 513public override async Task<IEnumerable<NuGetFramework>> GetSupportedFrameworksAsync( 518var frameworks = new HashSet<NuGetFramework>(NuGetFrameworkFullComparer.Instance); 827var fallbackGroup = referenceGroups.FirstOrDefault(g => g.TargetFramework.Equals(NuGetFramework.AnyFramework)); 995var groups = new Dictionary<NuGetFramework, List<string>>(NuGetFrameworkFullComparer.Instance); 1003var framework = GetFrameworkFromPath(path, allowSubFolders);
Resources\DependencyInfoResource.cs (2)
33NuGetFramework projectFramework, 47NuGetFramework projectFramework,
Resources\DependencyInfoResourceV3.cs (2)
65public override async Task<SourcePackageDependencyInfo> ResolvePackage(PackageIdentity package, NuGetFramework projectFramework, SourceCacheContext cacheContext, Common.ILogger log, CancellationToken token) 103public override async Task<IEnumerable<SourcePackageDependencyInfo>> ResolvePackages(string packageId, NuGetFramework projectFramework, SourceCacheContext cacheContext, Common.ILogger log, CancellationToken token)
sdk-tasks (1)
OverrideAndCreateBundledNETCoreAppPackageVersion.cs (1)
44.Select(tf => new { Raw = tf, Parsed = NuGetFramework.Parse(tf) })