166 references to ProjectStyle
aspire-managed (1)
NuGet\Commands\RestoreCommand.cs (1)
365ProjectStyle = ProjectStyle.PackageReference,
Microsoft.Build.NuGetSdkResolver (1)
RestoreRunnerEx.cs (1)
88ProjectStyle = ProjectStyle.PackageReference,
NuGet.Build.Tasks (23)
BuildTasksUtility.cs (17)
111private static HashSet<ProjectStyle> RestorableTypes = new HashSet<ProjectStyle>() 113ProjectStyle.DotnetCliTool, 114ProjectStyle.PackageReference, 115ProjectStyle.ProjectJson 304/// Try to parse the <paramref name="restoreProjectStyleProperty"/> and return the <see cref="ProjectStyle"/> value. 307/// <returns>The <see cref="ProjectStyle"/>. If the <paramref name="restoreProjectStyleProperty"/> is null the return vale will be null. </returns> 308public static ProjectStyle? GetProjectRestoreStyleFromProjectProperty(string restoreProjectStyleProperty) 310ProjectStyle projectStyle; 316projectStyle = ProjectStyle.Unknown; 334public static (ProjectStyle ProjectStyle, string PackagesConfigFilePath) GetProjectRestoreStyle(ProjectStyle? restoreProjectStyle, bool hasPackageReferenceItems, string projectDirectory, string projectName, Common.ILogger log) 336ProjectStyle projectStyle; 347projectStyle = ProjectStyle.PackageReference; 352projectStyle = ProjectStyle.PackagesConfig; 357projectStyle = ProjectStyle.Unknown; 374public static (ProjectStyle ProjectStyle, string PackagesConfigFilePath) GetProjectRestoreStyle(string restoreProjectStyle, bool hasPackageReferenceItems, string projectDirectory, string projectName, Common.ILogger log)
GetRestoreDotnetCliToolsTask.cs (1)
88properties.Add("ProjectStyle", ProjectStyle.DotnetCliTool.ToString());
GetRestoreProjectStyleTask.cs (3)
37/// Gets or sets the <see cref="ProjectModel.ProjectStyle"/> of the project. 40public ProjectStyle ProjectStyle { get; set; } 53IsPackageReferenceCompatibleProjectStyle = result.ProjectStyle == ProjectStyle.PackageReference;
RestoreTask.cs (2)
263if (project.RestoreMetadata.ProjectStyle == ProjectStyle.PackageReference) 275else if (project.RestoreMetadata.ProjectStyle == ProjectStyle.PackagesConfig)
NuGet.Build.Tasks.Console (9)
MSBuildStaticGraphRestore.cs (9)
1019(ProjectStyle projectStyle, string packagesConfigFilePath) = GetProjectStyle(project, projectsByTargetFramework, MSBuildLogger); 1032if (projectStyle == ProjectStyle.PackagesConfig) 1046CrossTargeting = (projectStyle == ProjectStyle.PackageReference) && ( 1058CentralPackageVersionsEnabled = isCentralPackageManagementEnabled && projectStyle == ProjectStyle.PackageReference, 1090static (ProjectStyle, string packagesConfigPath) GetProjectStyle(IMSBuildProject project, IReadOnlyDictionary<string, IMSBuildProject> tfms, Common.ILogger log) 1092ProjectStyle? projectStyleOrNull = BuildTasksUtility.GetProjectRestoreStyleFromProjectProperty(project.GetProperty("RestoreProjectStyle")); 1094(ProjectStyle ProjectStyle, string PackagesConfigFilePath) projectStyleResult = BuildTasksUtility.GetProjectRestoreStyle( 1363if (project.RestoreMetadata.ProjectStyle == ProjectStyle.PackageReference) 1375else if (project.RestoreMetadata.ProjectStyle == ProjectStyle.PackagesConfig)
NuGet.CommandLine.XPlat (1)
Commands\PackageReferenceCommands\AddPackageReferenceCommandRunner.cs (1)
88.Where(p => p.RestoreMetadata.ProjectStyle == ProjectStyle.PackageReference &&
NuGet.Commands (99)
RestoreCommand\LockFileBuilder.cs (3)
53if (project.RestoreMetadata?.ProjectStyle == ProjectStyle.PackageReference) 158var rootProjectStyle = project.RestoreMetadata?.ProjectStyle ?? ProjectStyle.Unknown;
RestoreCommand\RequestFactory\DependencyGraphSpecRequestProvider.cs (2)
114if (request.Request.ProjectStyle == ProjectStyle.DotnetCliTool) 203RestoreOutputPath = project.PackageSpec.RestoreMetadata.ProjectStyle == ProjectStyle.ProjectJson ? rootPath : project.PackageSpec.RestoreMetadata.OutputPath,
RestoreCommand\RequestFactory\NoOpRestoreResult.cs (2)
21public NoOpRestoreResult(bool success, string lockFilePath, Lazy<LockFile> lockFileLazy, CacheFile cacheFile, string cacheFilePath, ProjectStyle projectStyle, TimeSpan elapsedTime) : 42var isTool = ProjectStyle == ProjectStyle.DotnetCliTool;
RestoreCommand\RequestFactory\RestoreArgs.cs (4)
189if (request.ProjectStyle == ProjectStyle.PackageReference) 193else if (request.ProjectStyle != ProjectStyle.DotnetCliTool) 214if (request.ProjectStyle == ProjectStyle.ProjectJson 217request.ValidateRuntimeAssets = request.ProjectStyle == ProjectStyle.ProjectJson;
RestoreCommand\RestoreCommand.cs (7)
660&& _request.ProjectStyle == ProjectStyle.DotnetCliTool) 1271if (_request.Project.RestoreMetadata.ProjectStyle == ProjectStyle.ProjectJson) 1323if (_request.Project.RestoreMetadata.ProjectStyle == ProjectStyle.DotnetCliTool) 1464if (_request.ProjectStyle == ProjectStyle.DotnetCliTool && _request.AllowNoOp) 1492if (_request.ProjectStyle == ProjectStyle.DotnetCliTool) 1529if (_request.ProjectStyle == ProjectStyle.DotnetCliTool) 2299context.IsMsBuildBased = request.ProjectStyle != ProjectStyle.DotnetCliTool;
RestoreCommand\RestoreRequest.cs (2)
154public ProjectStyle ProjectStyle { get; set; } = ProjectStyle.Unknown;
RestoreCommand\RestoreResult.cs (3)
43public ProjectStyle ProjectStyle { get; } 122ProjectStyle projectStyle, 189var isTool = ProjectStyle == ProjectStyle.DotnetCliTool;
RestoreCommand\Utility\BuildAssetsUtils.cs (9)
91ProjectStyle restoreType) 99if (restoreType == ProjectStyle.PackageReference) 150ProjectStyle projectStyle, 179ProjectStyle projectStyle, 189ProjectStyle projectStyle, 298public static XDocument GenerateMSBuildFile(List<MSBuildRestoreItemGroup> groups, ProjectStyle outputType) 303if (outputType == ProjectStyle.PackageReference || groups.SelectMany(e => e.Items).Any()) 410if (project.RestoreMetadata?.ProjectStyle == ProjectStyle.PackageReference) 606if (request.ProjectStyle != ProjectStyle.ProjectJson
RestoreCommand\Utility\LockFileUtils.cs (2)
493ProjectStyle rootProjectStyle) 533if (rootProjectStyle == ProjectStyle.PackageReference)
RestoreCommand\Utility\MSBuildRestoreUtility.cs (24)
106if (spec.RestoreMetadata.ProjectStyle == ProjectStyle.PackageReference 107|| spec.RestoreMetadata.ProjectStyle == ProjectStyle.DotnetCliTool) 174ProjectStyle restoreType = GetProjectStyle(specItem); 196if (restoreType == ProjectStyle.PackageReference 197|| restoreType == ProjectStyle.DotnetCliTool 198|| restoreType == ProjectStyle.PackagesConfig) 223if (restoreType == ProjectStyle.PackageReference 224|| restoreType == ProjectStyle.DotnetCliTool) 239if (restoreType == ProjectStyle.PackageReference) 271if (restoreType == ProjectStyle.PackagesConfig) 435private static IEnumerable<TargetFrameworkInformation> GetTargetFrameworkInformation(string filePath, ProjectStyle restoreType, IEnumerable<IMSBuildItem> items) 466if (restoreType == ProjectStyle.PackageReference) 881private static PackageSpec GetBaseSpec(IMSBuildItem specItem, ProjectStyle projectStyle, IEnumerable<IMSBuildItem> items) 884spec.RestoreMetadata = projectStyle == ProjectStyle.PackagesConfig 890if (projectStyle == ProjectStyle.DotnetCliTool || projectStyle == ProjectStyle.Unknown || projectStyle == ProjectStyle.PackagesConfig) 895var needsAlias = projectStyle == ProjectStyle.DotnetCliTool; 1198private static ProjectStyle GetProjectStyle(IMSBuildItem projectSpecItem) 1201var restoreType = ProjectStyle.Unknown; 1215/// <param name="projectStyle">The <see cref="ProjectStyle?" /> of the specified project. Specify <see langword="null" /> when the project does not define a restore style.</param> 1217public static (bool IsEnabled, bool IsVersionOverrideDisabled, bool IsCentralPackageTransitivePinningEnabled, bool isCentralPackageFloatingVersionsEnabled) GetCentralPackageManagementSettings(IMSBuildItem projectSpecItem, ProjectStyle projectStyle) 1219if (projectStyle == ProjectStyle.PackageReference)
RestoreCommand\Utility\NoOpRestoreUtilities.cs (13)
42if (request.ProjectStyle == ProjectStyle.ProjectJson 43|| request.ProjectStyle == ProjectStyle.PackageReference) 64if (request.ProjectStyle == ProjectStyle.DotnetCliTool && lockFile != null) 107if (request.ProjectStyle == ProjectStyle.PackageReference 108|| request.ProjectStyle == ProjectStyle.ProjectJson) 112else if (request.ProjectStyle == ProjectStyle.DotnetCliTool) 133if (request.ProjectStyle == ProjectStyle.PackageReference) 202if (request.Project.RestoreMetadata.ProjectStyle == ProjectStyle.DotnetCliTool) 222/// <see cref="ProjectStyle.PackageReference"/>, <see cref="ProjectStyle.ProjectJson"/> 228if (request.ProjectStyle == ProjectStyle.ProjectJson 229|| request.ProjectStyle == ProjectStyle.PackageReference) 246if (request.ProjectStyle == ProjectStyle.DotnetCliTool)
RestoreCommand\Utility\PackageSpecFactory.cs (21)
284(ProjectStyle projectStyle, string? packagesConfigFilePath) = GetProjectStyle(project); 295if (projectStyle == ProjectStyle.PackagesConfig) 309CrossTargeting = (projectStyle == ProjectStyle.PackageReference) && ( 318CentralPackageVersionsEnabled = isCentralPackageManagementEnabled && projectStyle == ProjectStyle.PackageReference, 355static (ProjectStyle, string? packagesConfigPath) GetProjectStyle(IProject project) 357ProjectStyle? projectStyleOrNull = GetProjectRestoreStyleFromProjectProperty(project.OuterBuild.GetProperty("RestoreProjectStyle")); 361(ProjectStyle ProjectStyle, string? PackagesConfigFilePath) projectStyleResult = 511private static (ProjectStyle ProjectStyle, string? PackagesConfigFilePath) 512GetProjectRestoreStyle(ProjectStyle? restoreProjectStyle, bool hasPackageReferenceItems, string projectDirectory, string projectName) 514ProjectStyle projectStyle; 525projectStyle = ProjectStyle.PackageReference; 530projectStyle = ProjectStyle.PackagesConfig; 535projectStyle = ProjectStyle.Unknown; 647/// <param name="projectStyle">The <see cref="ProjectStyle?" /> of the specified project. Specify <see langword="null" /> when the project does not define a restore style.</param> 650GetCentralPackageManagementSettings(ITargetFramework project, ProjectStyle projectStyle) 652if (projectStyle == ProjectStyle.PackageReference) 701/// Try to parse the <paramref name="restoreProjectStyleProperty"/> and return the <see cref="ProjectStyle"/> value. 704/// <returns>The <see cref="ProjectStyle"/>. If the <paramref name="restoreProjectStyleProperty"/> is null the return vale will be null. </returns> 705private static ProjectStyle? GetProjectRestoreStyleFromProjectProperty(string? restoreProjectStyleProperty) 707ProjectStyle projectStyle; 713projectStyle = ProjectStyle.Unknown;
RestoreCommand\Utility\SpecValidationUtility.cs (5)
117if (projectStyle == ProjectStyle.DotnetCliTool) 133case ProjectStyle.PackageReference: 190ProjectStyle.PackageReference.ToString()); 202ProjectStyle.PackageReference.ToString()); 214ProjectStyle.PackageReference.ToString());
RestoreCommand\Utility\ToolRestoreUtility.cs (2)
51ProjectStyle = ProjectStyle.DotnetCliTool, 92if (requestSummary.Request.Project.RestoreMetadata?.ProjectStyle == ProjectStyle.DotnetCliTool)
NuGet.PackageManagement (13)
BuildIntegration\DependencyGraphRestoreUtility.cs (4)
230.FirstOrDefault(e => e.RestoreMetadata.ProjectStyle != ProjectStyle.DotnetCliTool); 271if (packageSpec.RestoreMetadata.ProjectStyle == ProjectStyle.PackageReference || 272packageSpec.RestoreMetadata.ProjectStyle == ProjectStyle.ProjectJson || 273packageSpec.RestoreMetadata.ProjectStyle == ProjectStyle.DotnetCliTool) // Don't add global tools to restore specs for solutions
IDE\PackageRestoreManager.cs (1)
195if (nuGetProject.ProjectStyle == ProjectStyle.PackagesConfig)
NuGetPackageManager.cs (2)
3033if (updatedPackageSpec.RestoreMetadata.ProjectStyle == ProjectStyle.PackageReference) 3327if (buildIntegratedProject.ProjectStyle == ProjectStyle.PackageReference)
Projects\MSBuildNuGetProject.cs (2)
104ProjectStyle = ProjectStyle.PackagesConfig; 679metadata.ProjectStyle = ProjectStyle.Unknown;
Projects\NuGetProject.cs (2)
31public ProjectModel.ProjectStyle ProjectStyle { get; protected set; } = ProjectModel.ProjectStyle.Unknown;
Projects\ProjectJsonNuGetProject.cs (2)
59ProjectStyle = ProjectStyle.ProjectJson; 186metadata.ProjectStyle = ProjectStyle.ProjectJson;
NuGet.ProjectModel (19)
DependencyGraphSpec.cs (1)
464if (project.RestoreMetadata.ProjectStyle != ProjectStyle.DotnetCliTool)
JsonPackageSpecReader.Utf8JsonStreamReader.cs (3)
765ProjectStyle? projectStyle = null; 872&& Enum.TryParse(projectStyleString, ignoreCase: true, result: out ProjectStyle projectStyleValue)) 1050if (projectStyle == ProjectStyle.PackagesConfig)
PackageSpecOperations.cs (2)
23/// if the <see cref="ProjectRestoreMetadata.ProjectStyle" /> is <see cref="ProjectStyle.PackageReference"/> 85/// if the <see cref="ProjectRestoreMetadata.ProjectStyle" /> is <see cref="ProjectStyle.PackageReference"/>
PackageSpecReferenceDependencyProvider.cs (8)
124var projectStyle = packageSpec?.RestoreMetadata?.ProjectStyle ?? ProjectStyle.Unknown; 126if (projectStyle == ProjectStyle.PackageReference || 127projectStyle == ProjectStyle.DotnetCliTool) 192var projectStyle = packageSpec.RestoreMetadata?.ProjectStyle ?? ProjectStyle.Unknown; 208|| (projectStyle != ProjectStyle.Unknown 209&& projectStyle != ProjectStyle.PackagesConfig))
PackageSpecWriter.cs (1)
106if (msbuildMetadata.ProjectStyle != ProjectStyle.Unknown)
ProjectLockFile\PackagesLockFileUtilities.cs (2)
223if (p2pSpec.RestoreMetadata.ProjectStyle == ProjectStyle.PackagesConfig || p2pSpec.RestoreMetadata.ProjectStyle == ProjectStyle.Unknown)
ProjectRestoreMetadata.cs (2)
21public ProjectStyle ProjectStyle { get; set; } = ProjectStyle.Unknown;