240 instantiations of ProjectCollection
dotnet (12)
dotnet.Tests (1)
dotnet-watch (1)
Microsoft.Build (3)
Definition\ProjectCollection.cs (2)
305/// 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.
461var local = new ProjectCollection(null, null, null, ToolsetDefinitionLocations.Default,
Microsoft.Build.Engine.OM.UnitTests (86)
Definition\Project_Tests.cs (33)
136using ProjectCollection collection = new ProjectCollection();
164using ProjectCollection collection = new ProjectCollection();
279Project project = (new ProjectCollection()).LoadProject(reader);
372using var collection = new ProjectCollection();
389Project project = new Project(xml, null, null, new ProjectCollection(), ProjectLoadSettings.IgnoreMissingImports);
404using ProjectCollection collection = new ProjectCollection();
434using ProjectCollection collection = new ProjectCollection();
470using ProjectCollection collection = new ProjectCollection();
507using ProjectCollection collection = new ProjectCollection();
991using ProjectCollection collection = new ProjectCollection(initial, null, ToolsetDefinitionLocations.ConfigurationFile);
1232using var collection = new ProjectCollection();
1262using var collection = new ProjectCollection();
1290using var collection = new ProjectCollection();
1322using var collection = new ProjectCollection(projectCollectionGlobalProperties);
1444using (var projectCollection = new ProjectCollection())
1509using (var projectCollection = new ProjectCollection())
1595using (var projectCollection = new ProjectCollection())
2423Project project = new Project(globalProperties, null, new ProjectCollection());
2442ProjectCollection collection = new ProjectCollection(globalProperties, loggers, ToolsetDefinitionLocations.None);
2466ProjectCollection collection = new ProjectCollection(globalProperties, loggers, ToolsetDefinitionLocations.None);
2536ProjectCollection collection = new ProjectCollection(globalProperties, loggers, ToolsetDefinitionLocations.None);
3572using (var projectCollection = new ProjectCollection())
3842using (var projectCollection = new ProjectCollection())
3894using (ProjectCollection collection = new ProjectCollection())
3943using (ProjectCollection collection = new ProjectCollection())
3987using (ProjectCollection collection = new ProjectCollection())
4034using (ProjectCollection collection = new ProjectCollection())
4074using (ProjectCollection collection = new ProjectCollection())
4117using (ProjectCollection collection = new ProjectCollection())
4160using (ProjectCollection collection = new ProjectCollection())
4198using (ProjectCollection collection = new ProjectCollection())
4263using ProjectCollection collection = new ProjectCollection();
4306using ProjectCollection collection = new();
Microsoft.Build.Engine.UnitTests (106)
Microsoft.Build.Tasks.UnitTests (8)
Microsoft.Build.UnitTests.Shared (10)
Microsoft.Build.Utilities.UnitTests (4)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (3)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.NET.Build.Tests (1)
MSBuild (2)
Msbuild.Tests.Utilities (1)
TaskUsageLogger (1)
646 references to ProjectCollection
dotnet (28)
Commands\Run\RunCommand.cs (6)
127Func<ProjectCollection, ProjectInstance>? projectFactory = null;
306private void EnsureProjectIsBuilt(out Func<ProjectCollection, ProjectInstance>? projectFactory, out RunProperties? cachedRunProperties, out VirtualProjectBuildingCommand? virtualCommand)
386internal ICommand GetTargetCommand(Func<ProjectCollection, ProjectInstance>? projectFactory, RunProperties? cachedRunProperties)
415static ProjectInstance EvaluateProject(string? projectFilePath, Func<ProjectCollection, ProjectInstance>? projectFactory, MSBuildArgs msbuildArgs, ILogger? binaryLogger)
421var collection = new ProjectCollection(globalProperties: globalProperties, loggers: binaryLogger is null ? null : [binaryLogger], toolsetDefinitionLocations: ToolsetDefinitionLocations.Default);
855using var collection = new ProjectCollection(globalProperties: globalProperties);
dotnet-openapi (1)
dotnet-watch (1)
Microsoft.Build (121)
Construction\ProjectRootElement.cs (22)
401public string EscapedFullPath => _escapedFullPath ?? (_escapedFullPath = ProjectCollection.Escape(FullPath));
751return Create(ProjectCollection.GlobalProjectCollection, Project.DefaultNewProjectTemplateOptions);
760return Create(ProjectCollection.GlobalProjectCollection, projectFileOptions);
767public static ProjectRootElement Create(ProjectCollection projectCollection)
773/// Initialize an in-memory, empty ProjectRootElement instance that can be saved later using the specified <see cref="ProjectCollection"/> and <see cref="NewProjectFileOptions"/>.
775public static ProjectRootElement Create(ProjectCollection projectCollection, NewProjectFileOptions projectFileOptions)
788return Create(path, ProjectCollection.GlobalProjectCollection, Project.DefaultNewProjectTemplateOptions);
797return Create(path, ProjectCollection.GlobalProjectCollection, newProjectFileOptions);
804public static ProjectRootElement Create(string path, ProjectCollection projectCollection)
813public static ProjectRootElement Create(string path, ProjectCollection projectCollection, NewProjectFileOptions newProjectFileOptions)
833return Create(xmlReader, ProjectCollection.GlobalProjectCollection, preserveFormatting: false);
841public static ProjectRootElement Create(XmlReader xmlReader, ProjectCollection projectCollection)
851public static ProjectRootElement Create(XmlReader xmlReader, ProjectCollection projectCollection, bool preserveFormatting)
866return Open(path, ProjectCollection.GlobalProjectCollection);
874public static ProjectRootElement Open(string path, ProjectCollection projectCollection)
884public static ProjectRootElement Open(string path, ProjectCollection projectCollection, bool? preserveFormatting)
908return TryOpen(path, ProjectCollection.GlobalProjectCollection);
916/// <param name="projectCollection">The <see cref="ProjectCollection"/> to load the project into.</param>
922public static ProjectRootElement TryOpen(string path, ProjectCollection projectCollection)
932/// <param name="projectCollection">The <see cref="ProjectCollection"/> to load the project into.</param>
941public static ProjectRootElement TryOpen(string path, ProjectCollection projectCollection, bool? preserveFormatting)
1787return 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)
226: this(projectFile, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
242public ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
260public ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection)
277internal ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, EvaluationContext context, bool interactive = false)
300private ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection,
331: this(xml, null, null, ProjectCollection.GlobalProjectCollection)
347public ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection projectCollection)
366public ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection)
542private ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection,
618internal ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, int visualStudioVersionFromSolution, ProjectCollection projectCollection, ISdkResolverService sdkResolverService, int submissionId)
633internal 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.CommandLine.UnitTests (1)
Microsoft.Build.Engine.OM.UnitTests (188)
Construction\ProjectFormatting_Tests.cs (14)
35ProjectCollection.GlobalProjectCollection.UnloadAllProjects();
112ProjectCollection.GlobalProjectCollection,
148ProjectCollection.GlobalProjectCollection,
184ProjectCollection.GlobalProjectCollection,
215ProjectCollection.GlobalProjectCollection,
245ProjectCollection.GlobalProjectCollection,
279ProjectCollection.GlobalProjectCollection,
318ProjectCollection.GlobalProjectCollection,
361ProjectCollection.GlobalProjectCollection,
388ProjectCollection.GlobalProjectCollection,
415ProjectRootElement xml = ProjectRootElement.Open(file, ProjectCollection.GlobalProjectCollection,
443ProjectCollection.GlobalProjectCollection,
470ProjectRootElement xml = ProjectRootElement.Open(file, ProjectCollection.GlobalProjectCollection,
693var project = new Project(ProjectRootElement.Open(file, ProjectCollection.GlobalProjectCollection));
Construction\ProjectMetadataElement_Tests.cs (12)
559ProjectCollection.GlobalProjectCollection,
603ProjectCollection.GlobalProjectCollection,
677ProjectCollection.GlobalProjectCollection,
720ProjectCollection.GlobalProjectCollection,
806ProjectCollection.GlobalProjectCollection,
869ProjectCollection.GlobalProjectCollection,
938ProjectCollection.GlobalProjectCollection,
981ProjectCollection.GlobalProjectCollection,
1053ProjectCollection.GlobalProjectCollection,
1093ProjectCollection.GlobalProjectCollection,
1164ProjectCollection.GlobalProjectCollection,
1211ProjectCollection.GlobalProjectCollection,
Definition\ProjectCollection_Tests.cs (90)
36ProjectCollection.GlobalProjectCollection.UnloadAllProjects();
44ProjectCollection.GlobalProjectCollection.UnloadAllProjects();
45Assert.Equal(0, ProjectCollection.GlobalProjectCollection.Count);
47IDictionary<string, string> globalProperties = ProjectCollection.GlobalProjectCollection.GlobalProperties;
50ProjectCollection.GlobalProjectCollection.RemoveGlobalProperty(propertyName);
53Assert.Empty(ProjectCollection.GlobalProjectCollection.GlobalProperties);
72Project project2 = ProjectCollection.GlobalProjectCollection.LoadProject(path);
96Assert.Equal(0, ProjectCollection.GlobalProjectCollection.Count);
101Project project2 = ProjectCollection.GlobalProjectCollection.LoadProject(path);
124using ProjectCollection collection = new ProjectCollection();
150Project project2 = ProjectCollection.GlobalProjectCollection.LoadProject("c:\\x");
166using var collection = new ProjectCollection();
197using ProjectCollection collection = new ProjectCollection();
228using ProjectCollection collection = new ProjectCollection();
251using var collection = new ProjectCollection();
267using var collection = new ProjectCollection();
281using var collection = new ProjectCollection();
302Assert.Equal(0, ProjectCollection.GlobalProjectCollection.Count);
304ProjectCollection.GlobalProjectCollection.LoadProject(path);
306Assert.Equal(1, ProjectCollection.GlobalProjectCollection.Count);
325using var collection = new ProjectCollection();
346using ProjectCollection collection1 = new ProjectCollection();
352using ProjectCollection collection2 = new ProjectCollection();
390ProjectCollection.GlobalProjectCollection.SetGlobalProperty("Configuration", "Debug");
397ProjectCollection.GlobalProjectCollection.LoadProject("c:\\1", globals, null);
399Assert.Equal(1, ProjectCollection.GlobalProjectCollection.Count);
425Assert.True(ReferenceEquals(project1, ProjectCollection.GlobalProjectCollection.LoadProject(projectDirectory, globalProperties1, ObjectModelHelpers.MSBuildDefaultToolsVersion)));
426Assert.True(ReferenceEquals(project2, ProjectCollection.GlobalProjectCollection.LoadProject(projectDirectory, globalProperties2, ObjectModelHelpers.MSBuildDefaultToolsVersion)));
428List<Project> projects = Helpers.MakeList(ProjectCollection.GlobalProjectCollection.LoadedProjects);
431Assert.Equal(2, ProjectCollection.GlobalProjectCollection.Count);
447ProjectCollection.GlobalProjectCollection.SetGlobalProperty("Configuration", "Debug");
458Project project2 = ProjectCollection.GlobalProjectCollection.LoadProject("c:\\1", project2Globals, null);
464ProjectCollection.GlobalProjectCollection.SetGlobalProperty("Platform", "X64");
473ProjectCollection.GlobalProjectCollection.SetGlobalProperty("Configuration", "Debug2");
474ProjectCollection.GlobalProjectCollection.SetGlobalProperty("Platform", "X86");
480ProjectCollection.GlobalProjectCollection.SetGlobalProperty("MyProperty", "MyValue2");
513Assert.True(ReferenceEquals(project1, ProjectCollection.GlobalProjectCollection.LoadProject("c:\\1", null, "2.0")));
514Assert.True(ReferenceEquals(project2, ProjectCollection.GlobalProjectCollection.LoadProject("c:\\1", null, ObjectModelHelpers.MSBuildDefaultToolsVersion)));
534Project project2 = ProjectCollection.GlobalProjectCollection.LoadProject("c:\\123.proj", null, null);
556Project project2 = ProjectCollection.GlobalProjectCollection.LoadProject("c:\\123.proj", null, null);
568using ProjectCollection collection = new ProjectCollection();
585using var collection = new ProjectCollection();
612using var collection = new ProjectCollection();
634using var collection = new ProjectCollection();
679using var collection = new ProjectCollection();
700Assert.Equal(1, ProjectCollection.GlobalProjectCollection.Count);
702ProjectCollection.GlobalProjectCollection.UnloadProject(project); // should not throw
704Assert.Equal(0, ProjectCollection.GlobalProjectCollection.Count);
705Assert.Empty(Helpers.MakeList(ProjectCollection.GlobalProjectCollection.LoadedProjects));
718ProjectCollection.GlobalProjectCollection.UnloadProject(project);
719ProjectCollection.GlobalProjectCollection.UnloadProject(xml);
726ProjectCollection.GlobalProjectCollection.LoadProject(xml.FullPath);
745ProjectCollection.GlobalProjectCollection.UnloadProject(project.Xml);
767ProjectCollection.GlobalProjectCollection.UnloadProject(importProject);
772ProjectCollection.GlobalProjectCollection.UnloadProject(importedXml);
792Assert.Equal(1, ProjectCollection.GlobalProjectCollection.Count);
794Assert.True(ReferenceEquals(project, Helpers.MakeList(ProjectCollection.GlobalProjectCollection.LoadedProjects)[0]));
796ProjectCollection.GlobalProjectCollection.UnloadProject(project); // should not throw
798Assert.Equal(0, ProjectCollection.GlobalProjectCollection.Count);
811ProjectCollection.GlobalProjectCollection.SetGlobalProperty("Configuration", "Debug");
838using ProjectCollection collection = new ProjectCollection();
878using var collection = new ProjectCollection();
921using var collection = new ProjectCollection();
951using var collection = new ProjectCollection();
971using var collection = new ProjectCollection();
995using var collection = new ProjectCollection();
1019ProjectCollection.GlobalProjectCollection.AddToolset(null);
1029using var collection = new ProjectCollection();
1051using var collection = new ProjectCollection();
1063ProjectCollection.GlobalProjectCollection.RemoveToolset(null);
1075ProjectCollection.GlobalProjectCollection.RemoveToolset(String.Empty);
1091using var collection = new ProjectCollection();
1111using var collection = new ProjectCollection(null, null, ToolsetDefinitionLocations.Registry);
1123ProjectCollection.GlobalProjectCollection.DefaultToolsVersion = String.Empty;
1135ProjectCollection.GlobalProjectCollection.DefaultToolsVersion = "nonexistent";
1145using var collection = new ProjectCollection();
1174using var collection = new ProjectCollection();
1266using var collection = new ProjectCollection();
1275using var collection2 = new ProjectCollection();
1284using var collection3 = new ProjectCollection();
1293using var collection4 = new ProjectCollection();
1302using var collection5 = new ProjectCollection();
1312using var collection6 = new ProjectCollection();
1320using var collection7 = new ProjectCollection();
1332using var collection = new ProjectCollection();
1391using var collection = new ProjectCollection();
1453ProjectCollection.Version.Major.ShouldBe(expectedVersion.Major);
1454ProjectCollection.Version.Minor.ShouldBe(expectedVersion.Minor);
1481private static void VerifyProjectCollectionEvents(ProjectCollection collection, bool expectEventRaised, string propertyValue)
1498Assert.Equal(ProjectCollection.Unescape(propertyValue), property.EvaluatedValue);
Microsoft.Build.Engine.UnitTests (236)
BackEnd\LoggingService_Tests.cs (11)
337LoggerDescription description = CreateLoggerDescription(className, typeof(ProjectCollection).GetTypeInfo().Assembly.FullName, true);
354LoggerDescription configurableDescription = CreateLoggerDescription(configurableClassName, typeof(ProjectCollection).GetTypeInfo().Assembly.FullName, true);
355LoggerDescription distributedDescription = CreateLoggerDescription(distributedClassName, typeof(ProjectCollection).GetTypeInfo().Assembly.FullName, true);
391LoggerDescription configurableDescriptionA = CreateLoggerDescription(configurableClassNameA, typeof(ProjectCollection).GetTypeInfo().Assembly.FullName, true);
392LoggerDescription configurableDescriptionB = CreateLoggerDescription(configurableClassNameB, typeof(ProjectCollection).GetTypeInfo().Assembly.FullName, true);
436LoggerDescription description = CreateLoggerDescription(className, typeof(ProjectCollection).GetTypeInfo().Assembly.FullName, true);
464LoggerDescription description = CreateLoggerDescription(className, typeof(ProjectCollection).GetTypeInfo().Assembly.FullName, true);
529LoggerDescription description = CreateLoggerDescription(className, typeof(ProjectCollection).GetTypeInfo().Assembly.FullName, true);
552loggerDescriptions.Add(CreateLoggerDescription(configurableClassName, typeof(ProjectCollection).GetTypeInfo().Assembly.FullName, true));
553loggerDescriptions.Add(CreateLoggerDescription(distributedClassName, typeof(ProjectCollection).GetTypeInfo().Assembly.FullName, true));
614LoggerDescription description = CreateLoggerDescription(className, typeof(ProjectCollection).GetTypeInfo().Assembly.FullName, true);
Evaluation\ProjectRootElementCache_Tests.cs (8)
29ProjectCollection.GlobalProjectCollection.UnloadAllProjects();
39ProjectCollection.GlobalProjectCollection.UnloadAllProjects();
51ProjectCollection.GlobalProjectCollection.ProjectRootElementCache.Get("c:\\foo", (p, c) => null, true, false);
62ProjectCollection.GlobalProjectCollection.ProjectRootElementCache.Get("c:\\foo", (p, c) => ProjectRootElement.Create("c:\\bar"), true, false);
73ProjectRootElement projectRootElement2 = ProjectCollection.GlobalProjectCollection.ProjectRootElementCache.Get(rootedPath, (p, c) => { throw new InvalidOperationException(); }, true, false);
90projectRootElement = ProjectCollection.GlobalProjectCollection.ProjectRootElementCache.Get(projectPath, (p, c) => { throw new InvalidOperationException(); }, true, false);
94ProjectCollection.GlobalProjectCollection.ProjectRootElementCache.DiscardStrongReferences();
98Assert.Null(ProjectCollection.GlobalProjectCollection.ProjectRootElementCache.TryGet(projectPath));
Instance\ProjectInstance_Internal_Tests.cs (16)
287using ProjectRootElementFromString projectRootElementFromString = new("<Project></Project>", ProjectCollection.GlobalProjectCollection, false, false);
300using var projectCollection = new ProjectCollection();
321using var collection = new ProjectCollection();
355using var collection = new ProjectCollection();
383using var collection = new ProjectCollection();
424using var collection = new ProjectCollection(projectCollectionGlobalProperties);
701public delegate ProjectInstance ProjectInstanceFactory(string file, ProjectRootElement xml, ProjectCollection collection);
765var projectCollection = env.CreateProjectCollection().Collection;
858using ProjectCollection projectCollection = new ProjectCollection();
892ProjectCollection projectCollection = testEnvironment.CreateProjectCollection().Collection;
920ProjectCollection projectCollection = testEnvironment.CreateProjectCollection().Collection;
957private static ProjectInstance GetProjectInstance(string content, HostServices hostServices, IDictionary<string, string> globalProperties, ProjectCollection projectCollection, string toolsVersion = null)
967using ProjectFromString projectFromString = new(content, globalProperties, toolsVersion ?? ObjectModelHelpers.MSBuildDefaultToolsVersion, projectCollection ?? ProjectCollection.GlobalProjectCollection);
994private static ProjectInstance GetSampleProjectInstance(HostServices hostServices, IDictionary<string, string> globalProperties, ProjectCollection projectCollection, string toolsVersion = null)
1027private static void CreateMockToolsetIfNotExists(string toolsVersion, ProjectCollection projectCollection)
1029ProjectCollection pc = projectCollection;
Microsoft.Build.Tasks.UnitTests (14)
Microsoft.Build.UnitTests.Shared (23)
ObjectModelHelpers.cs (11)
137public static void AssertItemEvaluationFromGenericItemEvaluator(Func<string, ProjectCollection, IList<ITestItem>> itemEvaluator, [StringSyntax(StringSyntaxAttribute.Xml)] string projectContents, string[] inputFiles, string[] expectedInclude, bool makeExpectedIncludeAbsolute = false, Dictionary<string, string>[] expectedMetadataPerItem = null, bool normalizeSlashes = false)
140using (var collection = new ProjectCollection())
662public static ProjectRootElement CreateInMemoryProjectRootElement([StringSyntax(StringSyntaxAttribute.Xml)] string projectContents, ProjectCollection collection = null, bool preserveFormatting = true)
703public static Project CreateInMemoryProject(ProjectCollection projectCollection, string xml, params ILogger[] loggers)
717ProjectCollection projectCollection,
773using ProjectCollection collection = new();
801using ProjectCollection collection = new();
984ProjectCollection projectCollection = new ProjectCollection();
1358var projectCollection = ProjectCollection.GlobalProjectCollection;
1761ProjectCollection projectCollection = null,
ProjectFromString.cs (7)
27: this(s, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
31public ProjectFromString(string s, IDictionary<string, string> globalProperties, string toolsVersion, ProjectCollection collection, ProjectLoadSettings loadSettings = ProjectLoadSettings.Default)
36public ProjectFromString(string s, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
55: this(s, ProjectCollection.GlobalProjectCollection)
59public ProjectRootElementFromString(string s, ProjectCollection projectCollection)
64public ProjectRootElementFromString(string s, ProjectCollection projectCollection, bool preserveFormatting)
71public ProjectRootElementFromString(string s, ProjectCollection projectCollection, bool isExplicitlyLoaded, bool preserveFormatting)
Microsoft.Build.Utilities.UnitTests (11)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (5)
Microsoft.DotNet.Cli.Utils (1)
Microsoft.NET.Build.Tasks (1)
Microsoft.NET.Build.Tests (1)
Microsoft.NET.Sdk.Publish.Tasks (1)
MSBuild (9)
XMake.cs (9)
767using (ProjectCollection collection = new(globalProperties, loggers, ToolsetDefinitionLocations.Default))
1252ProjectCollection projectCollection = null;
1663private static bool PrintTargets(string projectFile, string toolsVersion, Dictionary<string, string> globalProperties, TextWriter targetsWriter, ProjectCollection projectCollection)
1712ProjectCollection.DisplayVersion),
3506Assembly engineAssembly = typeof(ProjectCollection).GetTypeInfo().Assembly;
3565Assembly engineAssembly = typeof(ProjectCollection).GetTypeInfo().Assembly;
4018Console.WriteLine(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("MSBuildVersionMessage", ProjectCollection.DisplayVersion, NativeMethods.FrameworkName));
4062Console.WriteLine(ProjectCollection.Version.ToString());
4066Console.Write(ProjectCollection.Version.ToString());
Roslyn.Compilers.Extension (3)
TaskUsageLogger (1)