232 references to Xml
Microsoft.Build (27)
Definition\Project.cs (19)
481projectCollection.TryUnloadProject(Xml); 734/// The actual tools version on the Project tag, can be gotten from <see cref="Xml">Xml.ToolsVersion</see>. 752public string DirectoryPath => Xml.DirectoryPath; 762get => Xml.FullPath; 764set => Xml.FullPath = value; 814public ElementLocation ProjectFileLocation => Xml.ProjectFileLocation; 1430Xml.Save(); 1438Xml.Save(encoding); 1447Xml.Save(path); 1455Xml.Save(path, encoding); 1465Xml.Save(writer); 1809ErrorUtilities.VerifyThrowInvalidOperation(ReferenceEquals(Xml, otherXml), "OM_CannotModifyEvaluatedObjectInImportedFile", otherXml.Location.File); 4287RecordImport(null, Project.Xml, Project.Xml.Version, null); 4289ElementLocation toolsVersionLocation = Project.Xml.ProjectFileLocation; 4291if (Project.Xml.ToolsVersion.Length > 0) 4293OriginalProjectToolsVersion = Project.Xml.ToolsVersion; 4294toolsVersionLocation = Project.Xml.ToolsVersionLocation; 4299Project.Xml.ToolsVersion,
Definition\ProjectItem.cs (1)
251bool isImported = !Object.ReferenceEquals(_xml.ContainingProject, _project.Xml);
Definition\ProjectItemDefinition.cs (1)
173ProjectItemDefinitionElement itemDefinition = _project.Xml.AddItemDefinition(_itemType);
Definition\ProjectMetadata.cs (1)
214bool isImported = !Object.ReferenceEquals(_xml.ContainingProject, _parent.Project.Xml);
Definition\ProjectProperty.cs (2)
477bool isImported = !Object.ReferenceEquals(_xml.ContainingProject, _project.Xml); 601_project.Xml.AddProperty(_name, value);
Definition\ResolvedImport.cs (1)
46IsImported = importingElement != null && !ReferenceEquals(project.Xml, importingElement.ContainingProject);
Evaluation\Preprocessor.cs (1)
90XmlDocument outerDocument = _project.Xml.XmlDocument;
ObjectModelRemoting\DefinitionObjectsLinks\ProjectLink.cs (1)
24/// Access to remote <see cref="Project.Xml"/>.
Microsoft.Build.Engine.OM.UnitTests (171)
Construction\ConstructionEditing_Tests.cs (1)
3234p.Xml.AddProperty("propName", "propValue");
Construction\ElementLocationPublic_Tests.cs (2)
119string locations = project.Xml.Location.LocationString + "\r\n"; 123foreach (var element in project.Xml.AllChildren)
Construction\ProjectChooseElement_Tests.cs (1)
276ProjectChooseElement choose = Helpers.GetFirst(project.Xml.ChooseElements);
Construction\ProjectImportElement_Tests.cs (2)
180ProjectImportElement import = Helpers.GetFirst(project.Xml.Imports); 219ProjectImportElement import = Helpers.GetFirst(project.Xml.Imports);
Construction\ProjectRootElement_Tests.cs (1)
1066var pre = projects[current].Xml;
Definition\DefinitionEditing_Tests.cs (81)
161Helpers.VerifyAssertProjectContent(expected, project.Xml); 188Helpers.VerifyAssertProjectContent(expected, project.Xml); 220Helpers.VerifyAssertProjectContent(expected, project.Xml); 255Helpers.VerifyAssertProjectContent(expected, project.Xml); 346project.Xml.AddItem("i", "*.xxx"); 370project.Xml.AddItem("i", "*.xxx"); 395project.Xml.AddItem("i", "*.xxx"); 420ProjectItemElement itemElement = project.Xml.AddItem("i", "*.xxx"); 446ProjectItemElement itemElement = project.Xml.AddItem("i", "*.xxx"); 471ProjectItemElement item1 = project.Xml.AddItem("i", "*.xxx"); 496project.Xml.AddItem("i", "*.xxx"); 522ProjectItemElement item1 = project.Xml.AddItem( 558ProjectItemElement item1 = project.Xml.AddItem("i", @"c:\subdir1\**\subdir2\**\*.x?x"); 586ProjectItemElement item1 = project.Xml.AddItem("i", "*.xxx"); 614project.Xml.AddItem("i", "*.xxx"); 642project.Xml.AddItem("i", "a;*.xxx;b"); 673ProjectItemElement itemElement = project.Xml.AddItem("i", wildcard); 695Helpers.VerifyAssertProjectContent(expected, project.Xml); 739Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 775Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 794ProjectItemElement itemElement = project.Xml.AddItem("i", wildcard); 813Helpers.VerifyAssertProjectContent(expected, project.Xml); 831project.Xml.AddItem("i", "a;*.$(p);b"); 898ProjectItemElement newItemElement = Helpers.GetFirst((Helpers.GetFirst(project.Xml.ItemGroups)).Items); 926ProjectItemElement newItemElement = Helpers.GetLast((Helpers.GetLast(project.Xml.ItemGroups)).Items); 952ProjectItemElement newItemElement = Helpers.GetLast((Helpers.GetLast(project.Xml.ItemGroups)).Items); 1020Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 1031project.Xml.AddItem("i", "i1;i2;i3"); 1046Helpers.VerifyAssertProjectContent(expected, project.Xml); 1060project.Xml.AddItem("i", "i1;i2;i3"); 1078Helpers.VerifyAssertProjectContent(expected, project.Xml); 1099project.Xml.AddItem("i", wildcard); 1115Helpers.VerifyAssertProjectContent(expected, project.Xml); 1142string before = project.Xml.RawXml; 1147Helpers.VerifyAssertLineByLine(before, project.Xml.RawXml); 1186Helpers.VerifyAssertProjectContent(expected, project.Xml); 1188ProjectItemGroupElement itemGroupElement = Helpers.GetFirst(project.Xml.ItemGroups); 1233Helpers.VerifyAssertProjectContent(expected, project.Xml); 1236ProjectItemElement itemElement = Helpers.GetFirst(Helpers.GetFirst(project.Xml.ItemGroups).Items); 1256Helpers.VerifyAssertProjectContent(expected, project.Xml); 1266project.Xml.AddItem("i", "i1;i2"); 1280Helpers.VerifyAssertProjectContent(expected, project.Xml); 1282ProjectItemGroupElement itemGroupElement = Helpers.GetFirst(project.Xml.ItemGroups); 1310Helpers.VerifyAssertProjectContent(expected, project.Xml); 1351Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 1362project.Xml.AddItem("i", "i1;i2"); 1374Helpers.VerifyAssertProjectContent(expected, project.Xml); 1394ProjectItemElement itemElement = project.Xml.AddItem("i", wildcard); 1412Helpers.VerifyAssertProjectContent(expected, project.Xml); 1484Helpers.VerifyAssertProjectContent(expected, project.Xml); 1509Helpers.VerifyAssertProjectContent(expected, project.Xml); 1764project.Xml.ItemGroups.First().Parent.RemoveAllChildren(); 1767Assert.Single(project.Xml.Items); 1786Assert.Single(project.Xml.Properties); 1805Assert.Single(project.Xml.Properties); 1828Helpers.VerifyAssertProjectContent(expected, project.Xml); 1856Helpers.VerifyAssertProjectContent(expected, project.Xml); 1880Helpers.VerifyAssertProjectContent(expected, project.Xml); 1908Helpers.VerifyAssertProjectContent(expected, project.Xml); 1938Helpers.VerifyAssertProjectContent(expected, project.Xml); 1988Helpers.VerifyAssertProjectContent(expected, project.Xml); 2028Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 2065Helpers.VerifyAssertProjectContent(expected, project.Xml); 2085Helpers.VerifyAssertProjectContent(expected, project.Xml); 2112Helpers.VerifyAssertProjectContent(expected, project.Xml); 2144Helpers.VerifyAssertProjectContent(expected, project.Xml); 2179Helpers.VerifyAssertProjectContent(expected, project.Xml); 2267project.Xml.AddItem("i", "*.xxx"); 2291project.Xml.AddItem("i", "*.xxx"); 2316project.Xml.AddItem("i", "*.xxx"); 2341ProjectItemElement itemElement = project.Xml.AddItem("i", "*.xxx"); 2367ProjectItemElement itemElement = project.Xml.AddItem("i", "*.xxx"); 2392ProjectItemElement item1 = project.Xml.AddItem("i", "*.xxx"); 2417project.Xml.AddItem("i", "*.xxx"); 2443ProjectItemElement item1 = project.Xml.AddItem("i", 2475ProjectItemElement item1 = project.Xml.AddItem("i", @"c:\subdir1\**\subdir2\**\*.x?x"); 2503ProjectItemElement item1 = project.Xml.AddItem("i", "*.xxx"); 2531project.Xml.AddItem("i", "*.xxx"); 2559project.Xml.AddItem("i", "a;*.xxx;b"); 2600var initialXml = project.Xml.RawXml; 2607Assert.Equal(initialXml, project.Xml.RawXml);
Definition\EditingElementsReferencedByOrReferences_Tests.cs (8)
46Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 81Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 110Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 161Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 207Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 261Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 299Helpers.VerifyAssertProjectContent(expected, project.Xml, false); 333Helpers.VerifyAssertProjectContent(expected, project.Xml, false);
Definition\Project_Tests.cs (44)
409project.Xml.AddImport("$(MSBuildProjectFullPath)"); 441project.Xml.AddImport(file2); 445project2.Xml.AddImport(file); 477project.Xml.AddImport(file2); 478project.Xml.AddImport(file2); 516project.Xml.AddImport(file2); 517project.Xml.AddImport(file3); 521project.Xml.AddImport(file3); 859ProjectPropertyElement propertyElement = project.Xml.AddProperty("p", "v0"); 898ProjectPropertyElement propertyElement = project.Xml.AddProperty("p1", "v0"); 964ProjectPropertyElement propertyElement = project.Xml.AddProperty("pp", "vv"); 993ProjectPropertyElement propertyElement = project.Xml.AddProperty("pp", "vv"); 1029ProjectPropertyElement propertyElement = project.Xml.AddProperty("p", "v0"); 1090project.Xml.ToolsVersion.ShouldBe(string.Empty); 1120project.Xml.ToolsVersion = "2.0"; 1129project.Xml.ToolsVersion = "4.0"; 1149project.Xml.ToolsVersion = "2.0"; 1154project.Xml.ToolsVersion = ObjectModelHelpers.MSBuildDefaultToolsVersion; 1173project.Xml.ToolsVersion = "2.0"; 1182project.Xml.ToolsVersion = "4.0"; 1215project.Xml.ToolsVersion = "bogus"; 1217project.Xml.ToolsVersion.ShouldBe("bogus"); 1398project.Xml.AddImport(path); 1461project.Xml.AddImport(importFile); 1526project.Xml.AddImport(importFile); 1544newProject.Xml.AddImport(importFile); 1662project.Xml.AddItem("i", "i1"); 1663project.Xml.AddItem("i", "i1"); 1664project.Xml.AddItem("j", "j1"); 1665project.Xml.AddItem("j", "i1"); 1685project.Xml.AddItem("i", "i%261"); 1686project.Xml.AddItem("j", "i%25261"); 1687project.Xml.AddItem("k", "j1"); 1688project.Xml.AddItem("l", "i&1"); 1710project.Xml.AddItem("i", "i1"); 1770project.Xml.RawXml.ShouldNotContain(itemToRemove.Xml.Include); 1771project.Xml.RawXml.ShouldNotContain("*.foo"); 1791project.Xml.AddItem("i", "i1"); 1797project.Xml.AddItem("j", "i1"); 2055project.Xml.AddTarget("t"); 2185project.Xml.HasUnsavedChanges.ShouldBeTrue(); // Not dirty for saving 2202project.Xml.HasUnsavedChanges.ShouldBeFalse(); // Not dirty for saving 4268project.Xml.AddProperty(PropertyName, PropertyValue); 4269project.Xml.AddImport(ImportValue);
Definition\ProjectCollection_Tests.cs (14)
350Assert.True(ReferenceEquals(project1.Xml, project1b.Xml)); 355Assert.False(ReferenceEquals(project1.Xml, project2.Xml)); 616Helpers.ClearDirtyFlag(project1.Xml); 638Helpers.ClearDirtyFlag(project1.Xml); 655Helpers.ClearDirtyFlag(project1.Xml); 656Helpers.ClearDirtyFlag(project2.Xml); 684Helpers.ClearDirtyFlag(project1.Xml); 715ProjectRootElement xml = project.Xml; 745ProjectCollection.GlobalProjectCollection.UnloadProject(project.Xml); 760ProjectRootElement importedXml = importProject.Xml; 763mainProject.Xml.PrependChild(mainProject.Xml.CreateImportElement(importProject.FullPath));
Definition\ProjectItem_Tests.cs (2)
2228Assert.Equal(2, project.Xml.AllChildren.OfType<ProjectItemElement>().Count()); 2288Assert.Equal(2, project.Xml.AllChildren.OfType<ProjectItemElement>().Count());
Definition\ProjectItemDefinition_Tests.cs (2)
50Helpers.VerifyAssertProjectContent(expected, project.Xml); 180Helpers.VerifyAssertProjectContent(expected, project.Xml);
ObjectModelRemoting\Helpers\TestCollectionGroup.cs (1)
265linker.Collection.UnloadProject(p.Xml);
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (2)
211public ProjectXmlPair(ProjectPair pair) : base(null, pair.View.Xml, pair.Real.Xml) { this.Project = pair; this.PRE = this; }
ObjectModelRemoting\Helpers\ViewValidation.evaluation.cs (2)
334Verify(view.Xml, real.Xml);
ObjectModelRemoting\LinkedConstructionModify_Tests.cs (1)
44newReal.Xml.FullPath = tempPath;
ObjectModelRemoting\LinkedConstructionReadOnly_Tests.cs (3)
33this.RealXml = projReal.Xml; 37this.ViewXml = projView.Xml; 50this.ViewXml = projView.Xml;
ObjectModelRemoting\LinkedSpecialCasesScenarios.cs (3)
81newReal.Xml.FullPath = tempPath; 220CloneAndAddInternal(this.StdGroup.LocalBig.Xml); 246CopyFromInternal(this.StdGroup.LocalBig.Xml);
ObjectModelRemoting\RemoteProjectsProviderMock\EvaluationLinkMocks\MockProjectLink.cs (1)
28public MockProjectElementLinkRemoter Xml => this.OwningCollection.ExportElement(this.Source.Xml);
Microsoft.Build.Engine.UnitTests (29)
ConsoleLogger_Tests.cs (1)
148ProjectTargetElement target = project.Xml.AddTarget("T");
Definition\Project_Internal_Tests.cs (4)
134project.Xml.ToolsVersion = "2.0"; 139project.Xml.ToolsVersion = "4.0"; 185project.Xml.ToolsVersion = "2.0"; 190project.Xml.ToolsVersion = ObjectModelHelpers.MSBuildDefaultToolsVersion;
Definition\ToolsVersion_Tests.cs (2)
793ProjectInstance pi = new ProjectInstance(projectFromString.Project.Xml, null /* no global properties */, null /* don't explicitly set the toolsversion */, p); 903ProjectInstance pi = new ProjectInstance(projectFromString.Project.Xml, null /* no global properties */, null /* don't explicitly set the toolsversion */, p);
EscapingInProjects_Tests.cs (7)
222Helpers.CompareProjectXml(projectNewExpectedContents, project.Xml.RawXml); 267Helpers.CompareProjectXml(projectNewExpectedContents, project.Xml.RawXml); 316Helpers.CompareProjectXml(projectNewExpectedContents, project.Xml.RawXml); 372Helpers.CompareProjectXml(projectNewExpectedContents, project.Xml.RawXml); 434Helpers.CompareProjectXml(projectNewExpectedContents, project.Xml.RawXml); 475Helpers.CompareProjectXml(projectNewExpectedContents, project.Xml.RawXml); 517Helpers.CompareProjectXml(projectNewExpectedContents, project.Xml.RawXml);
Evaluation\Evaluator_Tests.cs (15)
1087project.Xml.DefaultTargets = "dt"; 1101project.Xml.DefaultTargets = "dt2"; 1153project.Xml.AddImport(importPathRelativeEscaped); 1154Console.WriteLine(project.Xml.RawXml); 1453ProjectPropertyElement xml1 = project.Xml.Properties.First(); 1532ProjectMetadataElement xml1 = project.Xml.ItemDefinitions.ElementAt(0).Metadata.ElementAt(0); 1592ProjectMetadataElement xml1 = project.Xml.ItemDefinitions.ElementAt(0).Metadata.ElementAt(0); 1595ProjectMetadataElement xml2 = project.Xml.Items.ElementAt(0).Metadata.ElementAt(0); 1630ProjectMetadataElement xml1 = project.Xml.Items.ElementAt(1).Metadata.ElementAt(0); 1662ProjectMetadataElement xml1 = project.Xml.Items.ElementAt(0).Metadata.ElementAt(0); 1687project.Xml.Items.First().Metadata.First(); 1726project.Xml.Items.First().Metadata.First(); 1851Assert.True(Object.ReferenceEquals(project.Xml, predecessor.Predecessor.Xml.ContainingProject)); 3272Assert.Equal("Foo;Goo", project.Xml.TreatAsLocalProperty); 3279project.Xml.TreatAsLocalProperty = "Foo";
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (2)
TargetTests.cs (2)
929proj.Xml.AddTarget("PrepareForBuild"); 958var task = proj.Xml.AddUsingTask(taskName, string.Empty, Assembly.GetExecutingAssembly().FullName);
Microsoft.Build.UnitTests.Shared (2)
ObjectModelHelpers.cs (2)
819string newActualProjectContents = project.Xml.RawXml; 1590VerifyAssertProjectContent(expected, project.Xml);
TaskUsageLogger (1)
TaskUsageLogger.cs (1)
225GatherAndEvaluatedTasksInFile(p.Xml, p, usingTasks);