167 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 289/// Try to parse the <paramref name="restoreProjectStyleProperty"/> and return the <see cref="ProjectStyle"/> value. 292/// <returns>The <see cref="ProjectStyle"/>. If the <paramref name="restoreProjectStyleProperty"/> is null the return vale will be null. </returns> 293public static ProjectStyle? GetProjectRestoreStyleFromProjectProperty(string restoreProjectStyleProperty) 295ProjectStyle projectStyle; 301projectStyle = ProjectStyle.Unknown; 319public static (ProjectStyle ProjectStyle, string PackagesConfigFilePath) GetProjectRestoreStyle(ProjectStyle? restoreProjectStyle, bool hasPackageReferenceItems, string projectDirectory, string projectName, Common.ILogger log) 321ProjectStyle projectStyle; 332projectStyle = ProjectStyle.PackageReference; 337projectStyle = ProjectStyle.PackagesConfig; 342projectStyle = ProjectStyle.Unknown; 359public static (ProjectStyle ProjectStyle, string PackagesConfigFilePath) GetProjectRestoreStyle(string restoreProjectStyle, bool hasPackageReferenceItems, string projectDirectory, string projectName, Common.ILogger log)
GetRestoreDotnetCliToolsTask.cs (1)
89properties.Add("ProjectStyle", ProjectStyle.DotnetCliTool.ToString());
GetRestoreProjectStyleTask.cs (3)
38/// Gets or sets the <see cref="ProjectModel.ProjectStyle"/> of the project. 41public ProjectStyle ProjectStyle { get; set; } 54IsPackageReferenceCompatibleProjectStyle = result.ProjectStyle == ProjectStyle.PackageReference;
RestoreTask.cs (2)
279if (project.RestoreMetadata.ProjectStyle == ProjectStyle.PackageReference) 291else if (project.RestoreMetadata.ProjectStyle == ProjectStyle.PackagesConfig)
NuGet.Build.Tasks.Console (10)
MSBuildStaticGraphRestore.cs (10)
941ProjectStyle = ProjectStyle.PackageReference, 1124(ProjectStyle projectStyle, string packagesConfigFilePath) = GetProjectStyle(project, projectsByTargetFramework, MSBuildLogger); 1137if (projectStyle == ProjectStyle.PackagesConfig) 1151CrossTargeting = (projectStyle == ProjectStyle.PackageReference) && ( 1163CentralPackageVersionsEnabled = isCentralPackageManagementEnabled && projectStyle == ProjectStyle.PackageReference, 1196static (ProjectStyle, string packagesConfigPath) GetProjectStyle(IMSBuildProject project, IReadOnlyDictionary<string, IMSBuildProject> tfms, Common.ILogger log) 1198ProjectStyle? projectStyleOrNull = BuildTasksUtility.GetProjectRestoreStyleFromProjectProperty(project.GetProperty("RestoreProjectStyle")); 1200(ProjectStyle ProjectStyle, string PackagesConfigFilePath) projectStyleResult = BuildTasksUtility.GetProjectRestoreStyle( 1485if (project.RestoreMetadata.ProjectStyle == ProjectStyle.PackageReference) 1497else 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) 159var rootProjectStyle = restoreMetadata?.ProjectStyle ?? ProjectStyle.Unknown;
RestoreCommand\RequestFactory\DependencyGraphSpecRequestProvider.cs (2)
115if (request.Request.ProjectStyle == ProjectStyle.DotnetCliTool) 205RestoreOutputPath = 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)
823&& _request.ProjectStyle == ProjectStyle.DotnetCliTool) 1470if (_request.Project.RestoreMetadata.ProjectStyle == ProjectStyle.ProjectJson) 1522if (_request.Project.RestoreMetadata.ProjectStyle == ProjectStyle.DotnetCliTool) 1678if (_request.ProjectStyle == ProjectStyle.DotnetCliTool && _request.AllowNoOp) 1706if (_request.ProjectStyle == ProjectStyle.DotnetCliTool) 1743if (_request.ProjectStyle == ProjectStyle.DotnetCliTool) 2513context.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 (10)
91ProjectStyle restoreType) 99if (restoreType == ProjectStyle.PackageReference) 151ProjectStyle projectStyle, 164ProjectStyle projectStyle, 195ProjectStyle projectStyle, 206ProjectStyle projectStyle, 315public static XDocument GenerateMSBuildFile(List<MSBuildRestoreItemGroup> groups, ProjectStyle outputType) 320if (outputType == ProjectStyle.PackageReference || groups.SelectMany(e => e.Items).Any()) 430if (project.RestoreMetadata?.ProjectStyle == ProjectStyle.PackageReference) 626if (request.ProjectStyle != ProjectStyle.ProjectJson
RestoreCommand\Utility\LockFileUtils.cs (2)
523ProjectStyle rootProjectStyle) 563if (rootProjectStyle == ProjectStyle.PackageReference)
RestoreCommand\Utility\MSBuildRestoreUtility.cs (25)
139if (spec.RestoreMetadata.ProjectStyle == ProjectStyle.PackageReference 140|| spec.RestoreMetadata.ProjectStyle == ProjectStyle.DotnetCliTool) 207ProjectStyle restoreType = GetProjectStyle(specItem); 233if (restoreType == ProjectStyle.PackageReference 234|| restoreType == ProjectStyle.DotnetCliTool 235|| restoreType == ProjectStyle.PackagesConfig) 260if (restoreType == ProjectStyle.PackageReference 261|| restoreType == ProjectStyle.DotnetCliTool) 276if (restoreType == ProjectStyle.PackageReference) 305if (restoreType == ProjectStyle.PackagesConfig) 376ProjectStyle = ProjectStyle.PackageReference, 519private static IEnumerable<TargetFrameworkInformation> GetTargetFrameworkInformation(string filePath, ProjectStyle restoreType, IEnumerable<IMSBuildItem> items) 550if (restoreType == ProjectStyle.PackageReference) 964private static PackageSpec GetBaseSpec(IMSBuildItem specItem, ProjectStyle projectStyle, IEnumerable<IMSBuildItem> items) 967spec.RestoreMetadata = projectStyle == ProjectStyle.PackagesConfig 973if (projectStyle == ProjectStyle.DotnetCliTool || projectStyle == ProjectStyle.Unknown || projectStyle == ProjectStyle.PackagesConfig) 978var needsAlias = projectStyle == ProjectStyle.DotnetCliTool; 1302private static ProjectStyle GetProjectStyle(IMSBuildItem projectSpecItem) 1305var restoreType = ProjectStyle.Unknown; 1319/// <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> 1321public static (bool IsEnabled, bool IsVersionOverrideDisabled, bool IsCentralPackageTransitivePinningEnabled, bool isCentralPackageFloatingVersionsEnabled) GetCentralPackageManagementSettings(IMSBuildItem projectSpecItem, ProjectStyle projectStyle) 1323if (projectStyle == ProjectStyle.PackageReference)
RestoreCommand\Utility\NoOpRestoreUtilities.cs (11)
48if (request.ProjectStyle == ProjectStyle.DotnetCliTool && lockFile != null) 83if (request.ProjectStyle == ProjectStyle.PackageReference 84|| request.ProjectStyle == ProjectStyle.ProjectJson) 89else if (request.ProjectStyle == ProjectStyle.DotnetCliTool) 110if (request.ProjectStyle == ProjectStyle.PackageReference) 179if (request.Project.RestoreMetadata.ProjectStyle == ProjectStyle.DotnetCliTool) 199/// <see cref="ProjectStyle.PackageReference"/>, <see cref="ProjectStyle.ProjectJson"/> 205if (request.ProjectStyle == ProjectStyle.ProjectJson 206|| request.ProjectStyle == ProjectStyle.PackageReference) 223if (request.ProjectStyle == ProjectStyle.DotnetCliTool)
RestoreCommand\Utility\PackageSpecFactory.cs (21)
127(ProjectStyle projectStyle, string? packagesConfigFilePath) = GetProjectStyle(project); 138if (projectStyle == ProjectStyle.PackagesConfig) 152CrossTargeting = (projectStyle == ProjectStyle.PackageReference) && ( 164CentralPackageVersionsEnabled = isCentralPackageManagementEnabled && projectStyle == ProjectStyle.PackageReference, 197static (ProjectStyle, string? packagesConfigPath) GetProjectStyle(IProject project) 199ProjectStyle? projectStyleOrNull = GetProjectRestoreStyleFromProjectProperty(project.OuterBuild.GetProperty("RestoreProjectStyle")); 203(ProjectStyle ProjectStyle, string? PackagesConfigFilePath) projectStyleResult = 366private static (ProjectStyle ProjectStyle, string? PackagesConfigFilePath) 367GetProjectRestoreStyle(ProjectStyle? restoreProjectStyle, bool hasPackageReferenceItems, string projectDirectory, string projectName) 369ProjectStyle projectStyle; 380projectStyle = ProjectStyle.PackageReference; 385projectStyle = ProjectStyle.PackagesConfig; 390projectStyle = ProjectStyle.Unknown; 506/// <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> 509GetCentralPackageManagementSettings(ITargetFramework project, ProjectStyle projectStyle) 511if (projectStyle == ProjectStyle.PackageReference) 560/// Try to parse the <paramref name="restoreProjectStyleProperty"/> and return the <see cref="ProjectStyle"/> value. 563/// <returns>The <see cref="ProjectStyle"/>. If the <paramref name="restoreProjectStyleProperty"/> is null the return vale will be null. </returns> 564private static ProjectStyle? GetProjectRestoreStyleFromProjectProperty(string? restoreProjectStyleProperty) 566ProjectStyle projectStyle; 572projectStyle = 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)
472if (project.RestoreMetadata.ProjectStyle != ProjectStyle.DotnetCliTool)
JsonPackageSpecReader.Utf8JsonStreamReader.cs (3)
766ProjectStyle? projectStyle = null; 874&& Enum.TryParse(projectStyleString, ignoreCase: true, result: out ProjectStyle projectStyleValue)) 1056if (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;