26 instantiations of TargetFrameworkInformation
aspire-managed (1)
NuGet\Commands\RestoreCommand.cs (1)
352var tfInfo = new TargetFrameworkInformation
Microsoft.Build.NuGetSdkResolver (1)
RestoreRunnerEx.cs (1)
59frameworks.Add(new TargetFrameworkInformation
NuGet.Build.Tasks (1)
GetReferenceNearestTargetFrameworkTask.cs (1)
149targetFrameworkInformations.Add(new TargetFrameworkInformation()
NuGet.Build.Tasks.Console (1)
MSBuildStaticGraphRestore.cs (1)
781var targetFrameworkInformation = new TargetFrameworkInformation()
NuGet.Build.Tasks.Pack (1)
PackTaskLogic.cs (1)
1017framework = new TargetFrameworkInformation(framework) { Dependencies = newFrameworkDependencies };
NuGet.CommandLine.XPlat (1)
Commands\PackageReferenceCommands\AddPackageReferenceCommandRunner.cs (1)
388project.TargetFrameworks[originalIndex] = new TargetFrameworkInformation(frameworkInfo) { Dependencies = newDependencies };
NuGet.Commands (9)
RestoreCommand\Utility\MSBuildRestoreUtility.cs (7)
568var targetFrameworkInfo = new TargetFrameworkInformation() 694spec.TargetFrameworks[index] = new TargetFrameworkInformation(frameworkInfo) { DownloadDependencies = newDownloadDependencies }; 711spec.TargetFrameworks[index] = new TargetFrameworkInformation(frameworkInfo) { Dependencies = dependencies.Add(dependency) }; 848spec.TargetFrameworks[i] = new TargetFrameworkInformation(spec.TargetFrameworks[i]) { PackagesToPrune = prunePackageReferences[spec.TargetFrameworks[i].TargetAlias] }; 941spec.TargetFrameworks[index] = new TargetFrameworkInformation(frameworkInfo) { FrameworkReferences = newFrameworkReferences }; 979new TargetFrameworkInformation() 1329spec.TargetFrameworks[index] = new TargetFrameworkInformation(frameworkInfo)
RestoreCommand\Utility\PackageSpecFactory.cs (1)
258var targetFrameworkInformation = new TargetFrameworkInformation()
RestoreCommand\Utility\ToolRestoreUtility.cs (1)
36new TargetFrameworkInformation
NuGet.PackageManagement (3)
BuildIntegration\BuildIntegratedRestoreUtility.cs (1)
187lockFile.PackageSpec.TargetFrameworks[i] = new TargetFrameworkInformation(frameworkInfo) { Dependencies = newDependencies };
Projects\MSBuildNuGetProject.cs (1)
665new TargetFrameworkInformation()
Projects\ProjectJsonNuGetProject.cs (1)
217packageSpec.TargetFrameworks[0] = new TargetFrameworkInformation(tfi) { FrameworkName = nuGetFramework };
NuGet.ProjectModel (8)
JsonPackageSpecReader.cs (1)
90targetFrameworkInformation = new TargetFrameworkInformation(targetFrameworkInformation) { FrameworkName = updatedFramework };
JsonPackageSpecReader.Utf8JsonStreamReader.cs (1)
1524var targetFrameworkInformation = new TargetFrameworkInformation()
PackageSpecExtensions.cs (2)
26return frameworkInfo ?? new TargetFrameworkInformation(); 139return new TargetFrameworkInformation();
PackageSpecOperations.cs (4)
66spec.TargetFrameworks[i] = new TargetFrameworkInformation(targetFramework) { Dependencies = newDependenciesImmutable }; 77spec.TargetFrameworks[i] = new TargetFrameworkInformation(framework) { Dependencies = newDependencies }; 171return new TargetFrameworkInformation(targetFramework) { Dependencies = newDependencies, CentralPackageVersions = newCentralPackageVersions }; 254spec.TargetFrameworks[i] = new TargetFrameworkInformation(framework) { Dependencies = remainingDependenciesImmutable };
138 references to TargetFrameworkInformation
aspire-managed (1)
NuGet\Commands\RestoreCommand.cs (1)
352var tfInfo = new TargetFrameworkInformation
Microsoft.Build.NuGetSdkResolver (1)
RestoreRunnerEx.cs (1)
55var frameworks = new List<TargetFrameworkInformation>(TargetFrameworks.Count);
NuGet.Build.Tasks (2)
GetReferenceNearestTargetFrameworkTask.cs (2)
145var targetFrameworkInformations = new List<TargetFrameworkInformation>(); 161var nearestNuGetFramework = packageSpec.GetNearestTargetFramework(projectNuGetFramework, CurrentProjectTargetFrameworkProperty);
NuGet.Build.Tasks.Console (10)
MSBuildStaticGraphRestore.cs (10)
491internal static List<ProjectRestoreMetadataFrameworkInfo> GetProjectRestoreMetadataFrameworkInfos(List<TargetFrameworkInformation> targetFrameworkInfos, IReadOnlyDictionary<string, IMSBuildProject> projects) 495foreach (var targetFrameworkInfo in targetFrameworkInfos) 744internal static List<TargetFrameworkInformation> GetTargetFrameworkInfos(IReadOnlyDictionary<string, IMSBuildProject> projectInnerNodes, bool isCpvmEnabled, bool isPruningEnabledGlobally) 746var targetFrameworkInfos = new List<TargetFrameworkInformation>(projectInnerNodes.Count); 763var assetTargetFallbackEnum = MSBuildStringUtility.Split(msBuildProjectInstance.GetProperty(nameof(TargetFrameworkInformation.AssetTargetFallback))).Select(NuGetFramework.Parse).ToList(); 781var targetFrameworkInformation = new TargetFrameworkInformation() 791RuntimeIdentifierGraphPath = msBuildProjectInstance.GetProperty(nameof(TargetFrameworkInformation.RuntimeIdentifierGraphPath)), 1065(ProjectRestoreMetadata restoreMetadata, List<TargetFrameworkInformation> targetFrameworkInfos) = GetProjectRestoreMetadataAndTargetFrameworkInformation(project, projectsByTargetFramework, settings); 1105private (ProjectRestoreMetadata RestoreMetadata, List<TargetFrameworkInformation> TargetFrameworkInfos) GetProjectRestoreMetadataAndTargetFrameworkInformation(IMSBuildProject project, IReadOnlyDictionary<string, IMSBuildProject> projectsByTargetFramework, ISettings settings) 1118List<TargetFrameworkInformation> targetFrameworkInfos = GetTargetFrameworkInfos(projectsByTargetFramework, isCentralPackageManagementEnabled, isPruningEnabledGlobally);
NuGet.Build.Tasks.Pack (6)
PackTaskLogic.cs (6)
382foreach (var tfm in assetsFile.PackageSpec.TargetFrameworks) 448foreach (var framework in assetsFile.PackageSpec.TargetFrameworks) 1008var framework = frameworks[i]; 1052TargetFrameworkInformation framework, 1074TargetFrameworkInformation framework, 1100TargetFrameworkInformation framework,
NuGet.CommandLine.XPlat (3)
Commands\Package\Update\PackageUpdateCommandRunner.cs (2)
494foreach (var tfm in project.TargetFrameworks) 617foreach (var tfm in project.TargetFrameworks)
Utility\MSBuildAPIUtility.cs (1)
789TargetFrameworkInformation tfmInformation;
NuGet.Commands (64)
PackagesLockFileBuilder.cs (1)
35TargetFrameworkInformation? framework = assetsFile.PackageSpec.GetTargetFramework(target.TargetAlias);
RestoreCommand\CompatibilityChecker.cs (2)
307var targetFrameworkInformation = (TargetFrameworkInformation)frameworkInfoObject;
RestoreCommand\DependencyGraphResolver.cs (6)
169TargetFrameworkInformation projectTargetFramework = _request.Project.GetTargetFramework(frameworkRuntimeDefinition.TargetAlias)!; 887/// <param name="projectTargetFramework">The <see cref="TargetFrameworkInformation" /> of the project.</param> 889private Dictionary<LibraryDependencyIndex, VersionRange>? IndexPinnedPackageVersions(bool isCentralPackageTransitivePinningEnabled, TargetFrameworkInformation? projectTargetFramework) 911TargetFrameworkInformation projectTargetFramework, 1424/// <param name="projectTargetFramework">The <see cref="TargetFrameworkInformation" /> containing target framework information for the project.</param> 1427private bool TryGetRuntimeGraph(List<NuGetv3LocalRepository> localRepositories, Dictionary<string, RestoreTargetGraph> graphsByTargetAlias, FrameworkRuntimeDefinition frameworkRuntimeDefinition, TargetFrameworkInformation? projectTargetFramework, [NotNullWhen(true)] out RuntimeGraph? runtimeGraph)
RestoreCommand\LockFileBuilder.cs (5)
185var tfi = project.GetTargetFramework(targetGraph.Framework); 431foreach (var frameworkInfo in project.TargetFrameworks 491TargetFrameworkInformation targetFrameworkInformation = project.TargetFrameworks.FirstOrDefault(i => i.FrameworkName.Equals(targetGraph.Framework)); 518/// <param name="targetFrameworkInformation">The <see cref="TargetFrameworkInformation" /> for the target framework to get centrally defined transitive dependencies for.</param> 521private IEnumerable<LibraryDependency> GetLibraryDependenciesForCentralTransitiveDependencies(RestoreTargetGraph targetGraph, TargetFrameworkInformation targetFrameworkInformation, ILogger logger)
RestoreCommand\Logging\PackageSpecificWarningProperties.cs (2)
37foreach (var framework in packageSpec.TargetFrameworks) 60var targetFrameworkInformation = packageSpec.GetTargetFramework(framework);
RestoreCommand\Logging\TransitiveNoWarnUtils.cs (1)
115TargetFrameworkInformation targetFrameworkInformation = nodeProjectSpec.GetTargetFramework(parentTargetFramework);
RestoreCommand\ProjectRestoreCommand.cs (2)
223foreach (TargetFrameworkInformation targetFrameworkInformation in packageSpec.TargetFrameworks.NoAllocEnumerate()) 236async Task<DownloadDependencyResolutionResult> ResolveDownloadDependenciesAsync(RemoteWalkContext context, TargetFrameworkInformation targetFrameworkInformation, CancellationToken token)
RestoreCommand\RestoreCommand.cs (14)
422foreach (var framework in project.TargetFrameworks.NoAllocEnumerate()) 888foreach (TargetFrameworkInformation framework in project.TargetFrameworks) 952foreach (TargetFrameworkInformation framework in project.TargetFrameworks) 991foreach (var framework in project.TargetFrameworks) 1025foreach (var framework in project.TargetFrameworks.NoAllocEnumerate()) 1039foreach (var framework in project.TargetFrameworks) 1047static bool ContainsPackage(KeyValuePair<string, List<string>> prunedPackage, TargetFrameworkInformation framework) 1079foreach (var frameworkInfo in _request.Project.TargetFrameworks) 1141foreach (TargetFrameworkInformation targetFrameworkInformation in _request.Project.TargetFrameworks) 1301internal static string GetTargetFrameworksAsString(IList<TargetFrameworkInformation> targetFrameworks) 1305foreach (TargetFrameworkInformation targetFramework in targetFrameworks) 2140foreach (TargetFrameworkInformation tfi in project.TargetFrameworks) 2279foreach (TargetFrameworkInformation framework in packageSpec.TargetFrameworks.NoAllocEnumerate()) 2285foreach (TargetFrameworkInformation framework in packageSpec.TargetFrameworks.NoAllocEnumerate())
RestoreCommand\Utility\AuditUtility.cs (4)
29private readonly IList<TargetFrameworkInformation> _targetFrameworks; 67IList<TargetFrameworkInformation> targetFrameworks, 94foreach (var targetFramework in _targetFrameworks.NoAllocEnumerate()) 133foreach (var targetFramework in _targetFrameworks.NoAllocEnumerate())
RestoreCommand\Utility\IncludeFlagUtils.cs (1)
43var specFramework = spec.GetTargetFramework(targetGraph.Framework);
RestoreCommand\Utility\LockFileUtils.cs (2)
507var targetFrameworkInformation = (TargetFrameworkInformation)frameworkInfoObject;
RestoreCommand\Utility\MSBuildRestoreUtility.cs (12)
518private static IEnumerable<TargetFrameworkInformation> GetTargetFrameworkInformation(string filePath, ProjectStyle restoreType, IEnumerable<IMSBuildItem> items) 568var targetFrameworkInfo = new TargetFrameworkInformation() 662TargetFrameworkInformation targetFrameworkInformation = spec.TargetFrameworks.Single(e => e.TargetAlias.Equals(frameworkPair.Key, StringComparison.Ordinal)); 689var frameworkInfo = spec.TargetFrameworks[index]; 704var frameworkInfo = spec.TargetFrameworks[index]; 726var dict = new Dictionary<string, TargetFrameworkInformation>(StringComparer.OrdinalIgnoreCase); 727foreach (var targetFramework in spec.TargetFrameworks) 756dict.TryGetValue(framework, out TargetFrameworkInformation frameworkInfo); 792foreach (var targetFramework in spec.TargetFrameworks) 932TargetFrameworkInformation frameworkInfo = spec.TargetFrameworks[index]; 1246IList<TargetFrameworkInformation> specFrameworks, 1327var frameworkInfo = spec.TargetFrameworks[index];
RestoreCommand\Utility\NoOpRestoreUtilities.cs (1)
259foreach (var targetFrameworkInformation in request.Project.TargetFrameworks)
RestoreCommand\Utility\PackageSpecFactory.cs (10)
47(ProjectRestoreMetadata? restoreMetadata, List<TargetFrameworkInformation>? targetFrameworkInfos) = GetProjectRestoreMetadataAndTargetFrameworkInformation(project, settings); 120private static (ProjectRestoreMetadata? RestoreMetadata, List<TargetFrameworkInformation>? TargetFrameworkInfos) GetProjectRestoreMetadataAndTargetFrameworkInformation(IProject project, ISettings settings) 134List<TargetFrameworkInformation> targetFrameworkInfos = GetTargetFrameworkInfos(project, isCentralPackageManagementEnabled, isPruningEnabledGlobally); 220internal static List<TargetFrameworkInformation> GetTargetFrameworkInfos(IProject project, bool isCpvmEnabled, bool isPruningEnabledGlobally) 222var targetFrameworkInfos = new List<TargetFrameworkInformation>(project.TargetFrameworks.Count); 239var assetTargetFallbackEnum = MSBuildStringUtility.Split(msBuildProjectInstance.GetProperty(nameof(TargetFrameworkInformation.AssetTargetFallback))).Select(NuGetFramework.Parse).ToList(); 258var targetFrameworkInformation = new TargetFrameworkInformation() 268RuntimeIdentifierGraphPath = msBuildProjectInstance.GetProperty(nameof(TargetFrameworkInformation.RuntimeIdentifierGraphPath)), 571internal static List<ProjectRestoreMetadataFrameworkInfo> GetProjectRestoreMetadataFrameworkInfos(List<TargetFrameworkInformation> targetFrameworkInfos, IReadOnlyDictionary<string, ITargetFramework> projects) 575foreach (var targetFrameworkInfo in targetFrameworkInfos)
RestoreCommand\Utility\SpecValidationUtility.cs (1)
154foreach (var framework in spec.TargetFrameworks)
NuGet.PackageManagement (5)
BuildIntegration\BuildIntegratedRestoreUtility.cs (1)
171var frameworkInfo = lockFile.PackageSpec.TargetFrameworks[i];
NuGetPackageManager.cs (2)
3221foreach (var framework in packageSpec.TargetFrameworks) 3336TargetFrameworkInformation matchingTfi = projectAction.RestoreResult.LockFile.PackageSpec.TargetFrameworks.Count == 1 ?
Projects\MSBuildNuGetProject.cs (1)
663packageSpec = new PackageSpec(new List<TargetFrameworkInformation>
Projects\ProjectJsonNuGetProject.cs (1)
205var tfi = packageSpec.TargetFrameworks[0];
NuGet.ProjectModel (46)
JsonPackageSpecReader.cs (1)
68private static void AddTargetFramework(PackageSpec packageSpec, NuGetFramework frameworkName, NuGetFramework secondaryFramework, TargetFrameworkInformation targetFrameworkInformation)
JsonPackageSpecReader.Utf8JsonStreamReader.cs (1)
1524var targetFrameworkInformation = new TargetFrameworkInformation()
LockFile\Utf8JsonStreamLockFileConverter.cs (1)
149lockFile.PackageSpec = new PackageSpec(Array.Empty<TargetFrameworkInformation>());
PackageSpec.cs (5)
24public PackageSpec(IList<TargetFrameworkInformation> frameworks) 29public PackageSpec() : this(new List<TargetFrameworkInformation>()) 34IList<TargetFrameworkInformation> frameworks, 63public IList<TargetFrameworkInformation> TargetFrameworks { get; private set; } 125List<TargetFrameworkInformation> targetFrameworks;
PackageSpecExtensions.cs (14)
16public static TargetFrameworkInformation GetTargetFramework(this PackageSpec project, NuGetFramework targetFramework) 18var frameworkInfo = project.TargetFrameworks.FirstOrDefault(f => NuGetFramework.Comparer.Equals(targetFramework, f.FrameworkName)); 37var projectFrameworkInfo = GetTargetFramework(project, targetFramework); 49/// Get the <see cref="TargetFrameworkInformation"/> for the given target alias. 54/// <returns>The <see cref="TargetFrameworkInformation"/> if it exists, <see langword="null"/> otherwise. </returns> 55public static TargetFrameworkInformation? GetTargetFramework(this PackageSpec project, string? targetAlias) 57foreach (var framework in project.TargetFrameworks.NoAllocEnumerate()) 98public static TargetFrameworkInformation GetNearestTargetFramework(this PackageSpec project, NuGetFramework targetFramework, string? targetAlias) 100TargetFrameworkInformation? result = null; 101List<TargetFrameworkInformation>? frameworks = null; 130foreach (var framework in frameworks) 141static void FindMatchingFrameworks(PackageSpec project, NuGetFramework targetFramework, ref TargetFrameworkInformation? matchedFramework, ref List<TargetFrameworkInformation>? matchingFrameworks) 143foreach (TargetFrameworkInformation framework in project.TargetFrameworks.NoAllocEnumerate())
PackageSpecOperations.cs (9)
24/// then the <see cref="TargetFrameworkInformation"/> will be updated, 41var targetFramework = spec.TargetFrameworks[i]; 73var framework = spec.TargetFrameworks[i]; 86/// then the <see cref="TargetFrameworkInformation"/> will be updated, 127var targetFramework = spec.TargetFrameworks[i]; 153var targetFramework = spec.TargetFrameworks[i]; 162private static TargetFrameworkInformation GetTargetFrameworkInformationWithAddedDependency(PackageSpec spec, PackageDependency dependency, TargetFrameworkInformation targetFramework) 236var framework = spec.TargetFrameworks[i];
PackageSpecReferenceDependencyProvider.cs (6)
218var targetFrameworkInfo = GetNearestTargetFrameworkWithFallbacks(packageSpec, targetFramework, alias); 238var targetFrameworkInfo = packageSpec.GetNearestTargetFramework(targetFramework, targetAlias); 302private static TargetFrameworkInformation GetNearestTargetFrameworkWithFallbacks( 306TargetFrameworkInformation initialResult = null) 308var targetFrameworkInfo = initialResult ?? packageSpec.GetNearestTargetFramework(targetFramework, targetAlias); 370TargetFrameworkInformation targetFrameworkInfo)
PackageSpecWriter.cs (2)
520private static void SetFrameworks(IObjectWriter writer, IList<TargetFrameworkInformation> frameworks, bool hashing, bool useTargetFrameworkAsKey) 526foreach (var framework in frameworks.OrderBy(c => c.TargetAlias, StringComparer.OrdinalIgnoreCase))
ProjectLockFile\PackagesLockFileUtilities.cs (3)
140foreach (var framework in project.TargetFrameworks) 180var targetFrameworkInformation = project.TargetFrameworks.FirstOrDefault(e => e.TargetAlias == restoreMetadataFramework.TargetAlias); 222TargetFrameworkInformation p2pSpecTargetFrameworkInformation = default;
TargetFrameworkInformation.cs (4)
19public class TargetFrameworkInformation : IEquatable<TargetFrameworkInformation> 133public TargetFrameworkInformation(TargetFrameworkInformation cloneFrom) 176return Equals(obj as TargetFrameworkInformation); 179public bool Equals(TargetFrameworkInformation other)