25 instantiations of ProjectCollection
dotnet (15)
dotnet-aot (1)
Microsoft.Build (3)
Definition\ProjectCollection.cs (2)
314/// This constructor disables target output logging, so TerminalLogger and other loggers may not work well. Prefer <see cref="ProjectCollection(IDictionary{string, string}, IEnumerable{ILogger}, IEnumerable{ForwardingLoggerRecord}, ToolsetDefinitionLocations, int, bool, bool, bool, bool, bool)"/> instead to control this behavior.
494var local = new ProjectCollection(null, null, ToolsetDefinitionLocations.Default,
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.HotReload.Watch (1)
MSBuild (2)
NuGet.Build.Tasks.Console (1)
220 references to ProjectCollection
dotnet (35)
Commands\Run\RunCommand.cs (7)
175Func<ProjectCollection, ProjectInstance>? projectFactory = null;
236internal ICommand GetTargetCommand(LaunchProfile? launchSettings, Func<ProjectCollection, ProjectInstance>? projectFactory, RunProperties? cachedRunProperties, bool runPropertiesFromEvaluation, FacadeLogger? logger)
424private void EnsureProjectIsBuilt(out Func<ProjectCollection, ProjectInstance>? projectFactory, out RunProperties? cachedRunProperties, out VirtualProjectBuildingCommand? projectBuilder, string? intermediateOutputPath, bool hasRuntimeEnvironmentVariableSupport)
520private ICommand GetTargetCommandForProject(ProjectLaunchProfile? launchSettings, Func<ProjectCollection, ProjectInstance>? projectFactory, RunProperties? cachedRunProperties, bool runPropertiesFromEvaluation, FacadeLogger? logger)
579static ProjectInstance EvaluateProject(string? projectFilePath, Func<ProjectCollection, ProjectInstance>? projectFactory, MSBuildArgs msbuildArgs, ILogger? binaryLogger)
582var collection = new ProjectCollection(globalProperties: globalProperties, loggers: binaryLogger is null ? null : [binaryLogger], toolsetDefinitionLocations: ToolsetDefinitionLocations.Default);
1100using var collection = new ProjectCollection(globalProperties: globalProperties);
dotnet-aot (6)
dotnet-openapi (1)
Microsoft.Build (127)
Construction\ProjectRootElement.cs (22)
401public string EscapedFullPath => _escapedFullPath ?? (_escapedFullPath = ProjectCollection.Escape(FullPath));
745return Create(ProjectCollection.GlobalProjectCollection, Project.DefaultNewProjectTemplateOptions);
754return Create(ProjectCollection.GlobalProjectCollection, projectFileOptions);
761public static ProjectRootElement Create(ProjectCollection projectCollection)
767/// Initialize an in-memory, empty ProjectRootElement instance that can be saved later using the specified <see cref="ProjectCollection"/> and <see cref="NewProjectFileOptions"/>.
769public static ProjectRootElement Create(ProjectCollection projectCollection, NewProjectFileOptions projectFileOptions)
782return Create(path, ProjectCollection.GlobalProjectCollection, Project.DefaultNewProjectTemplateOptions);
791return Create(path, ProjectCollection.GlobalProjectCollection, newProjectFileOptions);
798public static ProjectRootElement Create(string path, ProjectCollection projectCollection)
807public static ProjectRootElement Create(string path, ProjectCollection projectCollection, NewProjectFileOptions newProjectFileOptions)
827return Create(xmlReader, ProjectCollection.GlobalProjectCollection, preserveFormatting: false);
835public static ProjectRootElement Create(XmlReader xmlReader, ProjectCollection projectCollection)
845public static ProjectRootElement Create(XmlReader xmlReader, ProjectCollection projectCollection, bool preserveFormatting)
860return Open(path, ProjectCollection.GlobalProjectCollection);
868public static ProjectRootElement Open(string path, ProjectCollection projectCollection)
878public static ProjectRootElement Open(string path, ProjectCollection projectCollection, bool? preserveFormatting)
902return TryOpen(path, ProjectCollection.GlobalProjectCollection);
910/// <param name="projectCollection">The <see cref="ProjectCollection"/> to load the project into.</param>
916public static ProjectRootElement TryOpen(string path, ProjectCollection projectCollection)
926/// <param name="projectCollection">The <see cref="ProjectCollection"/> to load the project into.</param>
935public static ProjectRootElement TryOpen(string path, ProjectCollection projectCollection, bool? preserveFormatting)
1781return new ProjectRootElement(document, ProjectCollection.GlobalProjectCollection.ProjectRootElementCache);
Definition\Project.cs (26)
103internal Project(ProjectCollection projectCollection, ProjectLink link)
128: this(ProjectRootElement.Create(ProjectCollection.GlobalProjectCollection, newProjectFileOptions))
137public Project(ProjectCollection projectCollection)
147public Project(ProjectCollection projectCollection, NewProjectFileOptions newProjectFileOptions)
160public Project(IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
174public Project(IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection, NewProjectFileOptions newProjectFileOptions)
203: this(xml, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
218public Project(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
235public Project(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
253public Project(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
258private Project(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings,
297: this(xmlReader, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
312public Project(XmlReader xmlReader, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
329public Project(XmlReader xmlReader, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
347public Project(XmlReader xmlReader, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
352private Project(XmlReader xmlReader, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings,
390: this(projectFile, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
406public Project(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
424public Project(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
443public Project(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
448private Project(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings,
495options.ProjectCollection ?? ProjectCollection.GlobalProjectCollection,
515options.ProjectCollection ?? ProjectCollection.GlobalProjectCollection,
535options.ProjectCollection ?? ProjectCollection.GlobalProjectCollection,
587public ProjectCollection ProjectCollection { get; }
1996private ProjectCollection ProjectCollection => Owner.ProjectCollection;
Definition\Toolset.cs (4)
160public Toolset(string toolsVersion, string toolsPath, ProjectCollection projectCollection, string msbuildOverrideTasksPath)
176public Toolset(string toolsVersion, string toolsPath, IDictionary<string, string> buildProperties, ProjectCollection projectCollection, string msbuildOverrideTasksPath)
193public Toolset(string toolsVersion, string toolsPath, IDictionary<string, string> buildProperties, ProjectCollection projectCollection, IDictionary<string, SubToolset> subToolsets, string msbuildOverrideTasksPath)
294internal Toolset(string toolsVersion, string toolsPath, PropertyDictionary<ProjectPropertyInstance> buildProperties, ProjectCollection projectCollection, DirectoryGetFiles getFiles, LoadXmlFromPath loadXmlFromPath, string msbuildOverrideTasksPath, DirectoryExists directoryExists)
Graph\ProjectGraph.cs (19)
38/// <param name="projectCollection">The <see cref="ProjectCollection" /> context for parsing.</param>
58ProjectCollection projectCollection);
116: this(new ProjectGraphEntryPoint(entryProjectFile).AsEnumerable(), ProjectCollection.GlobalProjectCollection, null)
129: this(ProjectGraphEntryPoint.CreateEnumerable(entryProjectFiles), ProjectCollection.GlobalProjectCollection, null)
145public ProjectGraph(string entryProjectFile, ProjectCollection projectCollection)
162public ProjectGraph(IEnumerable<string> entryProjectFiles, ProjectCollection projectCollection)
188public ProjectGraph(string entryProjectFile, ProjectCollection projectCollection, ProjectInstanceFactoryFunc projectInstanceFactory)
206: this(new ProjectGraphEntryPoint(entryProjectFile, globalProperties).AsEnumerable(), ProjectCollection.GlobalProjectCollection, null)
223: this(ProjectGraphEntryPoint.CreateEnumerable(entryProjectFiles, globalProperties), ProjectCollection.GlobalProjectCollection, null)
243public ProjectGraph(string entryProjectFile, IDictionary<string, string> globalProperties, ProjectCollection projectCollection)
264public ProjectGraph(IEnumerable<string> entryProjectFiles, IDictionary<string, string> globalProperties, ProjectCollection projectCollection)
277: this(entryPoint.AsEnumerable(), ProjectCollection.GlobalProjectCollection, null)
289: this(entryPoints, ProjectCollection.GlobalProjectCollection, null)
304public ProjectGraph(ProjectGraphEntryPoint entryPoint, ProjectCollection projectCollection)
335ProjectCollection projectCollection,
375ProjectCollection projectCollection,
419ProjectCollection projectCollection,
971ProjectCollection projectCollection)
985ProjectCollection projectCollection,
Instance\ProjectInstance.cs (13)
234: this(projectFile, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
250public ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
268public ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection)
285internal ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, EvaluationContext context, bool interactive = false)
309private ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection,
341: this(xml, null, null, ProjectCollection.GlobalProjectCollection)
357public ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
376public ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection)
553private ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection,
630internal ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, int visualStudioVersionFromSolution, ProjectCollection projectCollection, ISdkResolverService sdkResolverService, int submissionId)
645internal ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, ILoggingService loggingService, int visualStudioVersionFromSolution, ProjectCollection projectCollection, ISdkResolverService sdkResolverService, int submissionId)
936options.ProjectCollection ?? ProjectCollection.GlobalProjectCollection,
956options.ProjectCollection ?? ProjectCollection.GlobalProjectCollection,
Microsoft.Build.Tasks.Git (7)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.DotNet.Cli.Utils (1)
Microsoft.DotNet.HotReload.Watch (7)
Microsoft.DotNet.ProjectTools (4)
Microsoft.NET.Build.Tasks (1)
Microsoft.NET.Sdk.Publish.Tasks (1)
Microsoft.SourceLink.AzureDevOpsServer.Git (1)
Microsoft.SourceLink.AzureRepos.Git (1)
Microsoft.SourceLink.Bitbucket.Git (1)
Microsoft.SourceLink.Gitea (1)
Microsoft.SourceLink.Gitee (1)
Microsoft.SourceLink.GitHub (1)
Microsoft.SourceLink.GitLab (1)
Microsoft.SourceLink.GitWeb (1)
MSBuild (9)
XMake.cs (9)
1049using (ProjectCollection collection = new(globalProperties, loggers, ToolsetDefinitionLocations.Default))
1375ProjectCollection.Version?.ToString(),
1615ProjectCollection projectCollection = null;
2025private static bool PrintTargets(string projectFile, string toolsVersion, Dictionary<string, string> globalProperties, TextWriter targetsWriter, ProjectCollection projectCollection)
2074ProjectCollection.DisplayVersion),
4116Assembly engineAssembly = typeof(ProjectCollection).Assembly;
4175Assembly engineAssembly = typeof(ProjectCollection).Assembly;
4636Console.WriteLine(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("MSBuildVersionMessage", ProjectCollection.DisplayVersion, NativeMethods.FrameworkName));
4691Console.WriteLine(ProjectCollection.Version.ToString());
NuGet.Build.Tasks.Console (1)
NuGet.CommandLine.XPlat (11)