27 instantiations of ProjectCollection
dotnet (18)
Microsoft.Build (3)
Definition\ProjectCollection.cs (2)
306/// 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.
462var local = new ProjectCollection(null, 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)
214 references to ProjectCollection
dotnet (38)
Commands\Run\RunCommand.cs (7)
179Func<ProjectCollection, ProjectInstance>? projectFactory = null;
237internal ICommand GetTargetCommand(LaunchProfile? launchSettings, Func<ProjectCollection, ProjectInstance>? projectFactory, RunProperties? cachedRunProperties, FacadeLogger? logger)
468private void EnsureProjectIsBuilt(out Func<ProjectCollection, ProjectInstance>? projectFactory, out RunProperties? cachedRunProperties, out VirtualProjectBuildingCommand? projectBuilder, string? intermediateOutputPath, bool hasRuntimeEnvironmentVariableSupport)
564private ICommand GetTargetCommandForProject(ProjectLaunchProfile? launchSettings, Func<ProjectCollection, ProjectInstance>? projectFactory, RunProperties? cachedRunProperties, FacadeLogger? logger)
610static ProjectInstance EvaluateProject(string? projectFilePath, Func<ProjectCollection, ProjectInstance>? projectFactory, MSBuildArgs msbuildArgs, ILogger? binaryLogger)
613var collection = new ProjectCollection(globalProperties: globalProperties, loggers: binaryLogger is null ? null : [binaryLogger], toolsetDefinitionLocations: ToolsetDefinitionLocations.Default);
1121using var collection = new ProjectCollection(globalProperties: globalProperties);
Microsoft.Build (124)
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)
115internal Project(ProjectCollection projectCollection, ProjectLink link)
140: this(ProjectRootElement.Create(ProjectCollection.GlobalProjectCollection, newProjectFileOptions))
149public Project(ProjectCollection projectCollection)
159public Project(ProjectCollection projectCollection, NewProjectFileOptions newProjectFileOptions)
172public Project(IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
186public Project(IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection, NewProjectFileOptions newProjectFileOptions)
215: this(xml, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
230public Project(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
247public Project(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
265public Project(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
270private Project(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings,
309: this(xmlReader, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
324public Project(XmlReader xmlReader, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
341public Project(XmlReader xmlReader, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
359public Project(XmlReader xmlReader, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
364private Project(XmlReader xmlReader, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings,
402: this(projectFile, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
418public Project(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
436public Project(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
455public Project(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
460private Project(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings,
506options.ProjectCollection ?? ProjectCollection.GlobalProjectCollection,
525options.ProjectCollection ?? ProjectCollection.GlobalProjectCollection,
544options.ProjectCollection ?? ProjectCollection.GlobalProjectCollection,
581public ProjectCollection ProjectCollection { get; }
1979private 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,
838ProjectCollection projectCollection)
852ProjectCollection projectCollection,
Instance\ProjectInstance.cs (13)
227: this(projectFile, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
243public ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
261public ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection)
278internal ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, EvaluationContext context, bool interactive = false)
301private ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection,
332: this(xml, null, null, ProjectCollection.GlobalProjectCollection)
348public ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
367public ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection)
543private ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection,
619internal ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, int visualStudioVersionFromSolution, ProjectCollection projectCollection, ISdkResolverService sdkResolverService, int submissionId)
634internal ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, ILoggingService loggingService, int visualStudioVersionFromSolution, ProjectCollection projectCollection, ISdkResolverService sdkResolverService, int submissionId)
925options.ProjectCollection ?? ProjectCollection.GlobalProjectCollection,
944options.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 (10)
XMake.cs (10)
824using (ProjectCollection collection = new(globalProperties, loggers, ToolsetDefinitionLocations.Default))
1119ProjectCollection.Version?.ToString(),
1341ProjectCollection projectCollection = null;
1755private static bool PrintTargets(string projectFile, string toolsVersion, Dictionary<string, string> globalProperties, TextWriter targetsWriter, ProjectCollection projectCollection)
1804ProjectCollection.DisplayVersion),
3676Assembly engineAssembly = typeof(ProjectCollection).GetTypeInfo().Assembly;
3735Assembly engineAssembly = typeof(ProjectCollection).GetTypeInfo().Assembly;
4196Console.WriteLine(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("MSBuildVersionMessage", ProjectCollection.DisplayVersion, NativeMethods.FrameworkName));
4254Console.WriteLine(ProjectCollection.Version.ToString());
4258Console.Write(ProjectCollection.Version.ToString());
NuGet.Build.Tasks.Console (1)
NuGet.CommandLine.XPlat (11)