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)
150targetFrameworkInformations.Add(new TargetFrameworkInformation()
NuGet.Build.Tasks.Console (1)
MSBuildStaticGraphRestore.cs (1)
788var targetFrameworkInformation = new TargetFrameworkInformation()
NuGet.Build.Tasks.Pack (1)
PackTaskLogic.cs (1)
1010framework = 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)
569var targetFrameworkInfo = new TargetFrameworkInformation() 695spec.TargetFrameworks[index] = new TargetFrameworkInformation(frameworkInfo) { DownloadDependencies = newDownloadDependencies }; 712spec.TargetFrameworks[index] = new TargetFrameworkInformation(frameworkInfo) { Dependencies = dependencies.Add(dependency) }; 849spec.TargetFrameworks[i] = new TargetFrameworkInformation(spec.TargetFrameworks[i]) { PackagesToPrune = prunePackageReferences[spec.TargetFrameworks[i].TargetAlias] }; 942spec.TargetFrameworks[index] = new TargetFrameworkInformation(frameworkInfo) { FrameworkReferences = newFrameworkReferences }; 980new TargetFrameworkInformation() 1343spec.TargetFrameworks[index] = new TargetFrameworkInformation(frameworkInfo)
RestoreCommand\Utility\PackageSpecFactory.cs (1)
259var 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)
1531var 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 };
140 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)
146var targetFrameworkInformations = new List<TargetFrameworkInformation>(); 162var nearestNuGetFramework = packageSpec.GetNearestTargetFramework(projectNuGetFramework, CurrentProjectTargetFrameworkProperty);
NuGet.Build.Tasks.Console (10)
MSBuildStaticGraphRestore.cs (10)
498internal static List<ProjectRestoreMetadataFrameworkInfo> GetProjectRestoreMetadataFrameworkInfos(List<TargetFrameworkInformation> targetFrameworkInfos, IReadOnlyDictionary<string, IMSBuildProject> projects) 502foreach (var targetFrameworkInfo in targetFrameworkInfos) 751internal static List<TargetFrameworkInformation> GetTargetFrameworkInfos(IReadOnlyDictionary<string, IMSBuildProject> projectInnerNodes, bool isCpvmEnabled, bool isPruningEnabledGlobally) 753var targetFrameworkInfos = new List<TargetFrameworkInformation>(projectInnerNodes.Count); 770var assetTargetFallbackEnum = MSBuildStringUtility.Split(msBuildProjectInstance.GetProperty(nameof(TargetFrameworkInformation.AssetTargetFallback))).Select(NuGetFramework.Parse).ToList(); 788var targetFrameworkInformation = new TargetFrameworkInformation() 798RuntimeIdentifierGraphPath = msBuildProjectInstance.GetProperty(nameof(TargetFrameworkInformation.RuntimeIdentifierGraphPath)), 1078(ProjectRestoreMetadata restoreMetadata, List<TargetFrameworkInformation> targetFrameworkInfos) = GetProjectRestoreMetadataAndTargetFrameworkInformation(project, projectsByTargetFramework, settings); 1118private (ProjectRestoreMetadata RestoreMetadata, List<TargetFrameworkInformation> TargetFrameworkInfos) GetProjectRestoreMetadataAndTargetFrameworkInformation(IMSBuildProject project, IReadOnlyDictionary<string, IMSBuildProject> projectsByTargetFramework, ISettings settings) 1131List<TargetFrameworkInformation> targetFrameworkInfos = GetTargetFrameworkInfos(projectsByTargetFramework, isCentralPackageManagementEnabled, isPruningEnabledGlobally);
NuGet.Build.Tasks.Pack (6)
PackTaskLogic.cs (6)
375foreach (var tfm in assetsFile.PackageSpec.TargetFrameworks) 441foreach (var framework in assetsFile.PackageSpec.TargetFrameworks) 1001var framework = frameworks[i]; 1045TargetFrameworkInformation framework, 1067TargetFrameworkInformation framework, 1093TargetFrameworkInformation 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)
791TargetFrameworkInformation tfmInformation;
NuGet.Commands (66)
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)
190var tfi = project.GetTargetFramework(targetGraph.TargetAlias); 441foreach (var frameworkInfo in project.TargetFrameworks 501TargetFrameworkInformation targetFrameworkInformation = project.TargetFrameworks.FirstOrDefault(i => i.FrameworkName.Equals(targetGraph.Framework)); 528/// <param name="targetFrameworkInformation">The <see cref="TargetFrameworkInformation" /> for the target framework to get centrally defined transitive dependencies for.</param> 531private 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 (16)
435foreach (var framework in project.TargetFrameworks.NoAllocEnumerate()) 515TargetFrameworkInformation targetFrameworkInformation = project.GetNearestTargetFramework(graph.Framework, graph.TargetAlias); 1051foreach (TargetFrameworkInformation framework in project.TargetFrameworks) 1120foreach (TargetFrameworkInformation framework in project.TargetFrameworks) 1151foreach (TargetFrameworkInformation framework in project.TargetFrameworks) 1190foreach (var framework in project.TargetFrameworks) 1224foreach (var framework in project.TargetFrameworks.NoAllocEnumerate()) 1238foreach (var framework in project.TargetFrameworks) 1246static bool ContainsPackage(KeyValuePair<string, List<string>> prunedPackage, TargetFrameworkInformation framework) 1278foreach (var frameworkInfo in _request.Project.TargetFrameworks) 1340foreach (TargetFrameworkInformation targetFrameworkInformation in _request.Project.TargetFrameworks) 1500internal static string GetTargetFrameworksAsString(IList<TargetFrameworkInformation> targetFrameworks) 1504foreach (TargetFrameworkInformation targetFramework in targetFrameworks) 2339foreach (TargetFrameworkInformation tfi in project.TargetFrameworks) 2478foreach (TargetFrameworkInformation framework in packageSpec.TargetFrameworks.NoAllocEnumerate()) 2484foreach (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)
537var targetFrameworkInformation = (TargetFrameworkInformation)frameworkInfoObject;
RestoreCommand\Utility\MSBuildRestoreUtility.cs (12)
519private static IEnumerable<TargetFrameworkInformation> GetTargetFrameworkInformation(string filePath, ProjectStyle restoreType, IEnumerable<IMSBuildItem> items) 569var targetFrameworkInfo = new TargetFrameworkInformation() 663TargetFrameworkInformation targetFrameworkInformation = spec.TargetFrameworks.Single(e => e.TargetAlias.Equals(frameworkPair.Key, StringComparison.Ordinal)); 690var frameworkInfo = spec.TargetFrameworks[index]; 705var frameworkInfo = spec.TargetFrameworks[index]; 727var dict = new Dictionary<string, TargetFrameworkInformation>(StringComparer.OrdinalIgnoreCase); 728foreach (var targetFramework in spec.TargetFrameworks) 757dict.TryGetValue(framework, out TargetFrameworkInformation frameworkInfo); 793foreach (var targetFramework in spec.TargetFrameworks) 933TargetFrameworkInformation frameworkInfo = spec.TargetFrameworks[index]; 1260IList<TargetFrameworkInformation> specFrameworks, 1341var 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); 221internal static List<TargetFrameworkInformation> GetTargetFrameworkInfos(IProject project, bool isCpvmEnabled, bool isPruningEnabledGlobally) 223var targetFrameworkInfos = new List<TargetFrameworkInformation>(project.TargetFrameworks.Count); 240var assetTargetFallbackEnum = MSBuildStringUtility.Split(msBuildProjectInstance.GetProperty(nameof(TargetFrameworkInformation.AssetTargetFallback))).Select(NuGetFramework.Parse).ToList(); 259var targetFrameworkInformation = new TargetFrameworkInformation() 269RuntimeIdentifierGraphPath = msBuildProjectInstance.GetProperty(nameof(TargetFrameworkInformation.RuntimeIdentifierGraphPath)), 585internal static List<ProjectRestoreMetadataFrameworkInfo> GetProjectRestoreMetadataFrameworkInfos(List<TargetFrameworkInformation> targetFrameworkInfos, IReadOnlyDictionary<string, ITargetFramework> projects) 589foreach (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)
1531var 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)
521private static void SetFrameworks(IObjectWriter writer, IList<TargetFrameworkInformation> frameworks, bool hashing, bool useTargetFrameworkAsKey) 527foreach (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)