1495 instantiations of XElement
aspire (17)
BuildBoss (1)
CustomEncryptorSample (3)
dotnet.Tests (5)
dotnet-svcutil-lib (13)
Shared\MSBuildProj.cs (12)
84_projectReferenceGroup = new XElement("ItemGroup");
107_referenceGroup = new XElement("ItemGroup");
131_packageReferenceGroup = new XElement("ItemGroup");
450XElement propertyGroup = new XElement(group);
538this.ProjectReferceGroup.Add(new XElement("ProjectReference", new XAttribute("Include", dependency.FullPath)));
541this.ReferenceGroup.Add(new XElement("Reference", new XAttribute("Include", dependency.AssemblyName), new XElement("HintPath", dependency.FullPath)));
544this.PacakgeReferenceGroup.Add(new XElement("PackageReference", new XAttribute("Include", dependency.Name), new XAttribute("Version", dependency.Version)));
547this.ReferenceGroup.Add(new XElement("DotNetCliToolReference", new XAttribute("Include", dependency.Name), new XAttribute("Version", dependency.Version)));
561this.ReferenceGroup.Add(new XElement("Content",
571this.PacakgeReferenceGroup.Add(new XElement("Content",
598XElement element = new XElement(propertyName, null);
dotnet-user-jwts (2)
dotnet-user-secrets (2)
EndToEnd.Tests (11)
IIS.FunctionalTests (2)
IIS.LongTests (3)
IIS.NewHandler.FunctionalTests (3)
IIS.NewShim.FunctionalTests (3)
IIS.ShadowCopy.Tests (1)
IISExpress.FunctionalTests (4)
illink (7)
Linker\WarningSuppressionWriter.cs (7)
66var xmlTree = new XElement("linker");
67var xmlAssembly = new XElement("assembly", new XAttribute("fullname", assemblyName.FullName));
73new XElement("attribute",
75new XElement("argument", Constants.ILLink),
76new XElement("argument", $"IL{warning.Code}"),
77new XElement("property", new XAttribute("name", UnconditionalSuppressMessageAttributeState.ScopeProperty),
79new XElement("property", new XAttribute("name", UnconditionalSuppressMessageAttributeState.TargetProperty),
ILLink.Tasks (1)
Metrics (17)
Metrics.Legacy (17)
Microsoft.AspNetCore.App.Analyzers.Test (8)
Microsoft.AspNetCore.Authentication.Test (7)
Microsoft.AspNetCore.DataProtection (46)
KeyManagement\XmlKeyManager.cs (13)
387var revocationElement = new XElement(RevocationElementName,
389new XElement(RevocationDateElementName, revocationDate),
391new XElement(KeyElementName,
393new XElement(ReasonElementName, reason));
524var keyElement = new XElement(KeyElementName,
527new XElement(CreationDateElementName, creationDate),
528new XElement(ActivationDateElementName, activationDate),
529new XElement(ExpirationDateElementName, expirationDate),
530new XElement(DescriptorElementName,
632var revocationElement = new XElement(RevocationElementName,
634new XElement(RevocationDateElementName, revocationDate),
635new XElement(KeyElementName,
637new XElement(ReasonElementName, reason));
Microsoft.AspNetCore.DataProtection.Tests (39)
KeyManagement\XmlKeyManagerTests.cs (10)
154new XElement("creationDate", creationDate),
155new XElement("activationDate", activationDate),
156new XElement("expirationDate", expirationDate));
253new XElement("creationDate", creationDate),
254new XElement("activationDate", activationDate),
255new XElement("expirationDate", expirationDate));
282new XElement("creationDate", creationDate),
283new XElement("activationDate", activationDate),
284new XElement("expirationDate", expirationDate));
712new XElement("revocationDate", revocationDate));
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
Microsoft.AspNetCore.Http.Connections.Tests (2)
Microsoft.AspNetCore.Identity.InMemory.Test (3)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (1)
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
Microsoft.AspNetCore.OpenApi.SourceGenerators (2)
Microsoft.AspNetCore.Rewrite (1)
Microsoft.AspNetCore.Server.IntegrationTesting (2)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (3)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
Microsoft.AspNetCore.SignalR.Tests (2)
Microsoft.Build.Tasks.Core (14)
Microsoft.Cci.Extensions (5)
Microsoft.CodeAnalysis (1)
Microsoft.CodeAnalysis.Analyzers (17)
Microsoft.CodeAnalysis.AnalyzerUtilities (17)
Microsoft.CodeAnalysis.BannedApiAnalyzers (17)
Microsoft.CodeAnalysis.CodeStyle (17)
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (26)
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (11)
179var element = new XElement("Tree",
187element.Add(new XElement("Captures",
189new XElement("Capture", new XAttribute("Name", kvp.Key), new XAttribute("Span", kvp.Value), GetTextAttribute(text, kvp.Value))),
191new XElement("Capture", new XAttribute("Name", kvp.Key), new XAttribute("Span", kvp.Value), GetTextAttribute(text, kvp.Value)))));
197=> new("Diagnostics",
199new XElement("Diagnostic",
212var element = new XElement(node.Kind.ToString());
227var element = new XElement(alternationNode.Kind.ToString());
236var element = new XElement(token.Kind.ToString());
245element.Add(new XElement("Trivia", token.LeadingTrivia.Select(t => TriviaToElement(t))));
257=> new(
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (17)
Microsoft.CodeAnalysis.PublicApiAnalyzers (17)
Microsoft.CodeAnalysis.ResxSourceGenerator (18)
Microsoft.CodeAnalysis.SemanticSearch.Extensions (2)
Microsoft.CodeAnalysis.Test.Utilities (4)
Microsoft.CodeAnalysis.Workspaces (19)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (4)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (8)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.Build.Manifest (5)
Microsoft.DotNet.Build.Tasks.Installers (10)
Microsoft.DotNet.Build.Tasks.Workloads (6)
Msi\WorkloadPackGroupMsi.wix.cs (5)
95componentGroupRefElement.ReplaceWith(Enumerable.Range(1, _package.Packs.Count).Select(n => new XElement(ns + "ComponentGroupRef", new XAttribute("Id", "CG_PackageContents" + n))));
105registryKeyElement.Add(new XElement(ns + "RegistryKey", new XAttribute("Key", pack.Id),
106new XElement(ns + "RegistryKey", new XAttribute("Key", pack.PackageVersion),
107new XElement(ns + "RegistryValue", new XAttribute("Value", ""), new XAttribute("Type", "string")))));
184var xml = new XElement(ns + "Directory");
Microsoft.DotNet.PackageTesting (9)
Microsoft.DotNet.SharedFramework.Sdk (11)
Microsoft.DotNet.SourceBuild.Tasks (12)
Microsoft.DotNet.XliffTasks (10)
Model\XlfDocument.cs (7)
49new XElement(Xliff,
54new XElement(File,
59new XElement(Body))));
188new(TransUnit,
190new XElement(Source, sourceNode.Source),
191new XElement(Target, new XAttribute("state", "new"), sourceNode.Source),
192new XElement(Note, sourceNode.Note == "" ? null : sourceNode.Note));
Microsoft.DotNet.XliffTasks.Tests (28)
XElementExtensionsTests.cs (28)
17new(TransUnit,
18new XElement(Source, "source text"),
19new XElement(Target, "target text"));
30new(TransUnit,
31new XElement(Source, "source text"),
32new XElement(Target, string.Empty));
43new(TransUnit,
44new XElement(Source, "source text"));
55new(TransUnit,
56new XElement(Source, "source text"),
57new XElement(Target, "original target text"),
58new XElement(Note));
69new(TransUnit,
70new XElement(Source, "source text"),
71new XElement(Note));
83new(TransUnit,
84new XElement(Target,
96new(TransUnit,
97new XElement(Target));
107XElement transUnitElement = new(TransUnit);
118new(TransUnit,
119new XElement(Source, "soruce text"),
120new XElement(Target,
133new(TransUnit,
134new XElement(Source, "soruce text"),
135new XElement(Target, "target text"));
146new(TransUnit,
147new XElement(Source, "soruce text"));
Microsoft.Extensions.AI.Evaluation.Safety (3)
Microsoft.Extensions.FileProviders.Embedded.Tests (6)
Microsoft.Maui.Resizetizer (13)
Microsoft.ML.Maml (16)
HelpCommand.cs (16)
463var content = new XElement("Components",
466select new XElement("Component",
468new XElement("Name", c.Info.UserName),
469string.IsNullOrWhiteSpace(c.Info.Summary) ? null : new XElement("Summary", c.Info.Summary),
470new XElement("LoadNames",
472select new XElement("LoadName", l)),
473new XElement("Type", c.Info.Type.ToString()),
474new XElement("SignatureTypes",
476select new XElement("SignatureType", s.ToString())),
479: new XElement("Arguments",
481select new XElement("Argument",
482new XElement("LongName", a.LongName),
485: new XElement("ShortNames",
487select new XElement("ShortName", sn)),
488new XElement("HelpText", a.HelpText),
509return new XElement("DefaultValue", a.DefaultValue);
Microsoft.NET.Build.Tasks (9)
Microsoft.NET.Build.Tasks.UnitTests (10)
Microsoft.NET.Build.Tests (338)
COMReferenceTests.cs (27)
40var reference = new XElement("ItemGroup",
41new XElement("COMReference",
43new XElement("Guid", "49a1950e-3e35-4595-8cb9-920c64c44d67"),
44new XElement("VersionMajor", "7"),
45new XElement("VersionMinor", "0"),
46new XElement("WrapperTool", "tlbimp"),
47new XElement("Lcid", "0"),
48new XElement("Isolated", "false"),
49new XElement("EmbedInteropTypes", embedInteropTypes)));
87var reference1 = new XElement("ItemGroup",
88new XElement("COMReference",
90new XElement("Guid", "49a1950e-3e35-4595-8cb9-920c64c44d67"),
91new XElement("VersionMajor", "7"),
92new XElement("VersionMinor", "0"),
93new XElement("WrapperTool", "tlbimp"),
94new XElement("Lcid", "0"),
95new XElement("Isolated", "false"),
96new XElement("EmbedInteropTypes", "false")));
99var reference2 = new XElement("ItemGroup",
100new XElement("COMReference",
102new XElement("Guid", "307953c0-7973-490a-a4a7-25999e023be8"),
103new XElement("VersionMajor", "8"),
104new XElement("VersionMinor", "0"),
105new XElement("WrapperTool", "tlbimp"),
106new XElement("Lcid", "0"),
107new XElement("Isolated", "false"),
108new XElement("EmbedInteropTypes", "false")));
GivenThatWeWantRuntimeConfigInBuiltProjectOutputGroup.cs (15)
74var propertyGroup = new XElement(ns + "PropertyGroup");
76propertyGroup.Add(new XElement(ns + "TieredCompilation", "false"));
77propertyGroup.Add(new XElement(ns + "ConcurrentGarbageCollection", "false"));
78propertyGroup.Add(new XElement(ns + "ThreadPoolMinThreads", "2"));
79propertyGroup.Add(new XElement(ns + "UseRidGraph", "true"));
109var propertyGroup = new XElement(ns + "PropertyGroup");
111propertyGroup.Add(new XElement(ns + "TieredCompilation", "true"));
112propertyGroup.Add(new XElement(ns + "ConcurrentGarbageCollection", "true"));
113propertyGroup.Add(new XElement(ns + "ThreadPoolMinThreads", "3"));
114propertyGroup.Add(new XElement(ns + "UseRidGraph", "false"));
135var propertyGroup = new XElement(ns + "PropertyGroup");
137propertyGroup.Add(new XElement(ns + "TieredCompilation", "false"));
138propertyGroup.Add(new XElement(ns + "ConcurrentGarbageCollection", "false"));
139propertyGroup.Add(new XElement(ns + "ThreadPoolMinThreads", "2"));
140propertyGroup.Add(new XElement(ns + "UseRidGraph", "true"));
GivenThatWeWantToBuildAComServerLibrary.cs (20)
56propertyGroup.Add(new XElement("EnableRegFreeCom", true));
89propertyGroup.Add(new XElement("RuntimeIdentifier", rid));
119propertyGroup.Add(new XElement("SelfContained", true));
158.WithProjectChanges(proj => proj.Root.Add(new XElement("ItemGroup", new XElement("ComHostTypeLibrary", new XAttribute("Include", "dummy1.tlb")))));
175new XElement("ItemGroup",
176new XElement("ComHostTypeLibrary", new XAttribute("Include", "dummy1.tlb")),
177new XElement("ComHostTypeLibrary", new XAttribute("Include", "dummy2.tlb")))));
196new XElement("ItemGroup",
197new XElement("ComHostTypeLibrary", new XAttribute("Include", "dummy1.tlb"), new XAttribute("Id", 1)),
198new XElement("ComHostTypeLibrary", new XAttribute("Include", "dummy2.tlb"), new XAttribute("Id", 1)))));
221new XElement("ItemGroup",
222new XElement("ComHostTypeLibrary", new XAttribute("Include", "dummy1.tlb"), new XAttribute("Id", id)))));
241new XElement("ItemGroup",
242new XElement("ComHostTypeLibrary", new XAttribute("Include", "dummy1.tlb"), new XAttribute("Id", 1)),
243new XElement("ComHostTypeLibrary", new XAttribute("Include", "dummy2.tlb"), new XAttribute("Id", 2)))));
258.WithProjectChanges(proj => proj.Root.Add(new XElement("ItemGroup", new XElement("ComHostTypeLibrary", new XAttribute("Include", "doesnotexist.tlb")))));
275.WithProjectChanges(proj => proj.Root.Add(new XElement("ItemGroup", new XElement("ComHostTypeLibrary", new XAttribute("Include", "invalid.tlb")))));
GivenThatWeWantToBuildACrossTargetedLibrary.cs (8)
94new XElement(ns + "RuntimeIdentifier", outerRid),
95new XElement(ns + "RuntimeIdentifiers", outerRids));
98new XElement(ns + "PropertyGroup",
100new XElement(ns + "RuntimeIdentifier", firstFrameworkRid),
101new XElement(ns + "RuntimeIdentifiers", firstFrameworkRids)),
102new XElement(ns + "PropertyGroup",
104new XElement(ns + "RuntimeIdentifier", secondFrameworkRid),
105new XElement(ns + "RuntimeIdentifiers", secondFrameworkRids)));
GivenThatWeWantToBuildADesktopExe.cs (22)
203propertyGroup.Add(new XElement(ns + "UseNativeCode", useNativeCode));
207propertyGroup.Add(new XElement(ns + "PlatformTarget", platformTarget));
213propertyGroup.Add(new XElement(ns + "TargetFrameworks", "net46;netcoreapp1.1"));
247propertyGroup.Add(new XElement(ns + "AppendPlatformToOutputPath", appendPlatformValue));
276propertyGroup.Add(new XElement(ns + "RuntimeIdentifier", rid));
277propertyGroup.Add(new XElement(ns + "AppendRuntimeIdentifierToOutputPath", useAppendOption.ToString()));
283propertyGroup.Add(new XElement(ns + "TargetFrameworks", "net46;netcoreapp1.1"));
475var itemGroup = new XElement(ns + "ItemGroup");
478itemGroup.Add(new XElement(ns + "Reference", new XAttribute("Include", "System")));
506var itemGroup = new XElement(ns + "ItemGroup");
509itemGroup.Add(new XElement(ns + "PackageReference",
570var itemGroup = new XElement(ns + "ItemGroup");
573itemGroup.Add(new XElement(ns + "PackageReference",
655var itemGroup = new XElement(ns + "ItemGroup");
658var httpReference = new XElement(ns + "Reference",
724var itemGroup = new XElement(ns + "ItemGroup");
727var httpReference = new XElement(ns + "Reference",
838new XElement("configuration",
839new XElement("startup",
840new XElement("supportedRuntime",
862new XElement("configuration",
863new XElement("appSettings")));
GivenThatWeWantToBuildADesktopExeWtihNetStandardLib.cs (12)
38itemGroup = new XElement(ns + "ItemGroup");
44itemGroup.Add(new XElement(ns + "ProjectReference",
52itemGroup.Add(new XElement(ns + "Reference",
54new XElement(ns + "HintPath", binaryPath)));
58itemGroup.Add(new XElement(ns + "Reference",
191var itemGroup = new XElement(ns + "ItemGroup");
198itemGroup.Add(new XElement(ns + "PackageReference",
204var target = new XElement(ns + "Target",
209target.Add(new XElement(ns + "FindUnderPath",
212new XElement(ns + "Output",
216target.Add(new XElement(ns + "Message",
220target.Add(new XElement(ns + "Error",
GivenThatWeWantToBuildALibrary.cs (18)
131propertyGroup.Add(new XElement(ns + "GenerateDocumentationFile", generateDocumentationFile.Value.ToString()));
135propertyGroup.Add(new XElement(ns + "DocumentationFile", documentationFile));
348targetFrameworkProperty.AddBeforeSelf(new XElement(ns + "TargetFrameworkIdentifier", frameworkName.Identifier));
349targetFrameworkProperty.AddBeforeSelf(new XElement(ns + "TargetFrameworkVersion", "v" + frameworkName.Version.ToString()));
352targetFrameworkProperty.AddBeforeSelf(new XElement(ns + "TargetFrameworkProfile", frameworkName.Profile));
409var propGroup = new XElement(ns + "PropertyGroup");
412var platformIdentifier = new XElement(ns + "TargetPlatformIdentifier", targetPlatformIdentifier);
414var platformVersion = new XElement(ns + "TargetPlatformVersion", targetPlatformVersion);
416var platformSupported = new XElement(ns + "TargetPlatformSupported", true);
418var disableUnnecessaryImplicitFrameworkReferencesForThisTest = new XElement(ns + "DisableImplicitFrameworkReferences", "true");
422propGroup.Add(new XElement(ns + "MSBuildEnableWorkloadResolver", false));
424var itemGroup = new XElement(ns + "ItemGroup");
428itemGroup.Add(new XElement(ns + "SdkSupportedTargetPlatformVersion", new XAttribute("Include", targetPlatform)));
448var propGroup = new XElement(ns + "PropertyGroup");
451var disableImplicitFrameworkDefines = new XElement(ns + "DisableImplicitFrameworkDefines", "true");
764.Add(new XElement(ns + "EnsureNETCoreAppRuntime", false));
829new XElement(ns + "PropertyGroup",
830new XElement(ns + "MarkPackageReferencesAsExternallyResolved",
GivenThatWeWantToBuildASelfContainedApp.cs (12)
39propertyGroup.Add(new XElement(ns + "RuntimeIdentifier", runtimeIdentifier));
99propertyGroup.Add(new XElement(ns + "RuntimeIdentifier", RuntimeIdentifier));
100propertyGroup.Add(new XElement(ns + "PlatformTarget", PlatformTarget));
127propertyGroup.Add(new XElement(ns + "RuntimeIdentifier", runtimeIdentifier));
128propertyGroup.Add(new XElement(ns + "PlatformTarget", "AnyCPU"));
422propertyGroup.Add(new XElement(ns + "RuntimeIdentifier", runtimeIdentifier));
425propertyGroup.Add(new XElement(ns + "SelfContained", "true"));
465propertyGroup.Add(new XElement(ns + "PublishSelfContained", "true"));
572propertyGroup.Add(new XElement(ns + "RuntimeIdentifier", runtimeIdentifier));
573propertyGroup.Add(new XElement(ns + "Prefer32Bit", "true"));
615propertyGroup.Add(new XElement(ns + "RuntimeIdentifier", runtimeIdentifier));
616propertyGroup.Add(new XElement(ns + "PreferNativeArm64", "true"));
GivenThatWeWantToControlGeneratedAssemblyInfo.cs (48)
117new XElement(ns + "Target",
119new XElement(ns + "PropertyGroup",
120new XElement("SourceRevisionId", ""))));
123new XElement(ns + "PropertyGroup",
124new XElement("SourceControlInformationFeatureSupported", "true")));
148new XElement(ns + "Target",
150new XElement(ns + "PropertyGroup",
151new XElement("SourceRevisionId", "xyz"))));
154new XElement(ns + "PropertyGroup",
155new XElement("SourceControlInformationFeatureSupported", "true"),
156new XElement("IncludeSourceRevisionInInformationalVersion", "false")));
180new XElement(ns + "Target",
183new XElement(ns + "PropertyGroup",
184new XElement("SourceRevisionId", "xyz"))));
187new XElement(ns + "Target",
191new XElement(ns + "PropertyGroup",
192new XElement("SourceControlInformationFeatureSupported", "true")));
216new XElement(ns + "Target",
219new XElement(ns + "PropertyGroup",
220new XElement("SourceRevisionId", "xyz"))));
223new XElement(ns + "Target",
227new XElement(ns + "PropertyGroup",
228new XElement("SourceControlInformationFeatureSupported", "true"),
229new XElement("InformationalVersion", "1.2.3+abc")));
351new XElement(ns + "ItemGroup",
352new XElement(ns + "InternalsVisibleTo",
380new XElement(ns + "PropertyGroup",
381new XElement(ns + "EnablePreviewFeatures", $"{enablePreviewFeatures}")));
386new XElement(ns + "PropertyGroup",
387new XElement(ns + "GenerateRequiresPreviewFeaturesAttribute", $"False")));
446new XElement(ns + "PropertyGroup",
447new XElement(ns + "EnablePreviewFeatures", "false")));
543new XElement(ns + "PropertyGroup",
544new XElement(ns + "GenerateInternalsVisibleToAttributes", "false")),
545new XElement(ns + "ItemGroup",
546new XElement(ns + "InternalsVisibleTo",
570new XElement(ns + "ItemGroup",
571new XElement(ns + "InternalsVisibleTo",
596new XElement(ns + "PropertyGroup",
597new XElement(ns + "PublicKey", "00240000048000009400000006020000002400005253413100040000010001001d3e6bbb36e11ea61ceff6e1022b23dd779fc6230838db2d25a2c7c8433b3fcf86b16c25b281fc3db1027c0675395e7d0548e6add88b6a811962bf958101fa9e243b1618313bee11f5e3b3fefda7b1d1226311b6cc2d07e87ff893ba6890b20082df34a0aac14b605b8be055e81081a626f8c69e9ed4bbaa4eae9f94a35accd2")),
598new XElement(ns + "ItemGroup",
599new XElement(ns + "InternalsVisibleTo",
623new XElement(ns + "ItemGroup",
624new XElement(ns + "AssemblyMetadata",
649new XElement(ns + "PropertyGroup",
650new XElement(ns + "GenerateAssemblyMetadataAttributes", "false")),
651new XElement(ns + "ItemGroup",
652new XElement(ns + "AssemblyMetadata",
GivenThatWeWantToReferenceAProject.cs (10)
211var itemGroup = new XElement(ns + "ItemGroup");
214var content = new XElement(ns + "Content",
220var projRef = new XElement(ns + "ProjectReference",
224var target = new XElement(ns + "Target",
229var propertyGroup = new XElement(ns + "PropertyGroup");
230propertyGroup.Add(new XElement("ResultOutput", "@(AllItemsFullPathWithTargetPath)"));
265p.Root.Add(new XElement(ns + "ItemGroup",
266new XElement(ns + "Content", new XAttribute("Include", "a.txt"), new XAttribute("CopyToOutputDirectory", "PreserveNewest"))));
328var itemGroup = new XElement(ns + "ItemGroup",
330var projRef = new XElement(ns + "ProjectReference",
GivenThatWeWantToUseAnalyzers.cs (15)
29project.Root.Add(new XElement(ns + "PropertyGroup", new XElement("EnableRequestDelegateGenerator", isEnabled)));
51project.Root.Add(new XElement(ns + "PropertyGroup", new XElement("EnableConfigurationBindingGenerator", isEnabled)));
68project.Root.Add(new XElement(ns + "PropertyGroup", new XElement("PublishAot", "true")));
100project.Root.Add(new XElement(ns + "PropertyGroup", new XElement("PublishTrimmed", "true")));
173project.Root.Add(new XElement(ns + "ItemGroup",
174new XElement(ns + "FrameworkReference", new XAttribute("Include", "Microsoft.AspNetCore.App"))));
177project.Root.Add(new XElement(ns + "PropertyGroup",
178new XElement(ns + "EnableConfigurationBindingGenerator", "true")));
238new XElement(ns + "ItemGroup",
239new XElement(ns + "PackageReference",
242new XElement(ns + "PackageReference",
GivenThereAreDefaultItems.cs (38)
69var propertyGroup = new XElement(ns + "PropertyGroup");
71propertyGroup.Add(new XElement(ns + "OutputPath", "Output"));
109project.Root.Element(ns + "PropertyGroup").Add(new XElement(ns + "EnableDefaultItems", "False"));
111XElement itemGroup = new(ns + "ItemGroup");
113itemGroup.Add(new XElement(ns + "Compile", new XAttribute("Include", "**\\*.cs")));
153XElement itemGroup = new(ns + "ItemGroup");
155itemGroup.Add(new XElement(ns + "Compile", new XAttribute("Include", "..\\Shared\\**\\*.cs")));
189XElement itemGroup = new(ns + "ItemGroup");
191itemGroup.Add(new XElement(ns + "Compile", new XAttribute("Remove", "Excluded\\**\\*.cs")));
226XElement itemGroup = new(ns + "ItemGroup");
228itemGroup.Add(new XElement(ns + "Compile", new XAttribute("Include", "obj\\Class2.cs")));
262XElement itemGroup = new(ns + "ItemGroup");
264itemGroup.Add(new XElement(ns + "EmbeddedResource", new XAttribute("Include", "CSharpAsResource.cs")));
265itemGroup.Add(new XElement(ns + "Compile", new XAttribute("Remove", "CSharpAsResource.cs")));
312XElement itemGroup = new(ns + "ItemGroup");
314itemGroup.Add(new XElement(ns + "Content", new XAttribute("Include", "CSharpAsContent.cs"),
316itemGroup.Add(new XElement(ns + "Compile", new XAttribute("Remove", "CSharpAsContent.cs")));
380XElement itemGroup = new(ns + "ItemGroup");
382itemGroup.Add(new XElement(ns + "Compile", new XAttribute("Include", testProject.Name + ".cs")));
383itemGroup.Add(new XElement(ns + "Compile", new XAttribute("Include", testProject.Name + "Program.cs")));
447var propertyGroup = new XElement(ns + "PropertyGroup");
449propertyGroup.Add(new XElement(ns + "EnableDefaultContentItems", "false"));
452var itemGroup = new XElement(ns + "ItemGroup");
454itemGroup.Add(new XElement(ns + "None", new XAttribute("Update", "@(None)"), new XAttribute("CopyToOutputDirectory", "PreserveNewest")));
495new XElement(ns + "EnableDefaultCompileItems", "false"));
497var itemGroup = new XElement(ns + "ItemGroup");
499itemGroup.Add(new XElement(ns + "Compile", new XAttribute("Include", "Program.cs")));
524var itemGroup = new XElement(ns + "ItemGroup");
526itemGroup.Add(new XElement(ns + "Compile", new XAttribute("Include", @"**\*.cs")));
560new XElement(ns + "NetStandardImplicitPackageVersion", "0.1.0-does-not-exist"));
562var itemGroup = new XElement(ns + "ItemGroup");
566itemGroup.Add(new XElement(ns + "PackageReference",
594var itemGroup = new XElement(ns + "ItemGroup");
597itemGroup.Add(new XElement(ns + "FrameworkReference",
633new XElement(ns + "DisableImplicitFrameworkReferences", "true"));
635var itemGroup = new XElement(ns + "ItemGroup");
638itemGroup.Add(new XElement(ns + "FrameworkReference",
641itemGroup.Add(new XElement(ns + "FrameworkReference",
Microsoft.NET.Pack.Tests (7)
Microsoft.NET.Publish.Tests (71)
GivenThatWeWantToPublishAnAotApp.cs (9)
546project.Root.Add(new XElement(ns + "ItemGroup",
547new XElement(ns + "KnownILCompilerPack",
549new XElement(ns + "ILCompilerRuntimeIdentifiers", runtimeIdentifiers),
550new XElement(ns + "ILCompilerPortableRuntimeIdentifiers", runtimeIdentifiers))));
1033target = new XElement(ns + "Target",
1039target.Add(new XElement(ns + "ItemGroup",
1040new XElement("ManagedAssemblyToLink",
1271project.Root.Add(new XElement(ns + "ItemGroup",
1272new XElement("RuntimeHostConfigurationOption",
GivenThatWeWantToRunILLink.cs (19)
154project.Root.Add(new XElement(ns + "ItemGroup",
155new XElement("KnownILLinkPack",
1875var itemGroup = new XElement(ns + "ItemGroup");
1877itemGroup.Add(new XElement(ns + "TrimmerRootDescriptor",
1900target = new XElement(ns + "Target",
1906target.Add(new XElement(ns + "ItemGroup",
1907new XElement("ManagedAssemblyToLink",
1916var properties = new XElement(ns + "PropertyGroup");
1918properties.Add(new XElement(ns + "TrimMode",
1926var properties = new XElement(ns + "PropertyGroup");
1928properties.Add(new XElement(ns + "TrimmerDefaultAction", action));
1941var target = new XElement(ns + "Target",
1945var items = new XElement(ns + "ItemGroup");
1947items.Add(new XElement("ManagedAssemblyToLink",
1948new XElement("Condition", "true"),
1949new XElement("IsTrimmable", "true")));
1950items.Add(new XElement(ns + "TrimmerRootAssembly",
1980project.Root.Add(new XElement(ns + "ItemGroup",
1981new XElement("RuntimeHostConfigurationOption",
PublishTestUtils.cs (12)
119project.Root.Add(new XElement(ns + "PropertyGroup",
121new XElement(ns + "TargetFrameworkIdentifier", ".NETStandard"),
122new XElement(ns + "TargetFrameworkVersion", "v2.0")));
123project.Root.Add(new XElement(ns + "PropertyGroup",
125new XElement(ns + "TargetFrameworkIdentifier", ".NETCoreApp"),
126new XElement(ns + "TargetFrameworkVersion", "v6.0")));
127project.Root.Add(new XElement(ns + "PropertyGroup",
129new XElement(ns + "TargetFrameworkIdentifier", ".NETCoreApp"),
130new XElement(ns + "TargetFrameworkVersion", "v7.0")));
131project.Root.Add(new XElement(ns + "PropertyGroup",
133new XElement(ns + "TargetFrameworkIdentifier", ".NETCoreApp"),
134new XElement(ns + "TargetFrameworkVersion", "v8.0")));
Microsoft.NET.Restore.Tests (6)
Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests (7)
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (5)
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (199)
WasmBuildIntegrationTest.cs (54)
31var itemGroup = new XElement("PropertyGroup");
32var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
63var itemGroup = new XElement("PropertyGroup");
64var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
101document.Root.Add(new XElement("PropertyGroup",
102new XElement("WasmFingerprintAssets", false)));
111reference.Add(new XElement(
152var itemGroup = new XElement("PropertyGroup");
153var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
190var itemGroup = new XElement("PropertyGroup");
191var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
237var itemGroup = new XElement("PropertyGroup");
238var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
281var itemGroup = new XElement(ns + "PropertyGroup");
282itemGroup.Add(new XElement("BlazorEnableTimeZoneSupport", false));
283itemGroup.Add(new XElement("WasmFingerprintAssets", false));
313var itemGroup = new XElement(ns + "PropertyGroup");
314itemGroup.Add(new XElement("InvariantGlobalization", true));
315itemGroup.Add(new XElement("WasmFingerprintAssets", false));
351var itemGroup = new XElement(ns + "PropertyGroup");
352itemGroup.Add(new XElement("InvariantGlobalization", true));
353itemGroup.Add(new XElement("WasmFingerprintAssets", false));
389var itemGroup = new XElement(ns + "PropertyGroup");
390itemGroup.Add(new XElement("BlazorIcuDataFileName", customIcuFilename));
391itemGroup.Add(new XElement("WasmFingerprintAssets", false));
432var itemGroup = new XElement(ns + "PropertyGroup");
433itemGroup.Add(new XElement("BlazorIcuDataFileName", customIcuFilename));
434itemGroup.Add(new XElement("WasmFingerprintAssets", false));
476var itemGroup = new XElement(ns + "PropertyGroup");
477itemGroup.Add(new XElement("BlazorWebAssemblyLoadAllGlobalizationData", true));
478itemGroup.Add(new XElement("WasmFingerprintAssets", false));
518var itemGroup = new XElement(ns + "PropertyGroup");
519itemGroup.Add(new XElement("BlazorWebAssemblyLoadAllGlobalizationData", true));
520itemGroup.Add(new XElement("WasmFingerprintAssets", false));
577var propertyGroup = new XElement(ns + "PropertyGroup");
578propertyGroup.Add(new XElement("DefineConstants", @"$(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies"));
579propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
580var itemGroup = new XElement(ns + "ItemGroup");
581itemGroup.Add(new XElement("ProjectReference", new XAttribute("Include", @"..\classlibrarywithsatelliteassemblies\classlibrarywithsatelliteassemblies.csproj")));
633var propertyGroup = new XElement(ns + "PropertyGroup");
634propertyGroup.Add(new XElement("BaseOutputPath", @"$(MSBuildThisFileDirectory)build\bin\"));
635propertyGroup.Add(new XElement("BaseIntermediateOutputPath", @"$(MSBuildThisFileDirectory)build\obj\"));
662var propertyGroup = new XElement(project.Root.Name.Namespace + "PropertyGroup");
663propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
673var itemGroup = new XElement(ns + "ItemGroup",
674new XElement(ns + "Reference",
727var propertyGroup = new XElement(ns + "PropertyGroup");
728propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
749var itemGroup = new XElement(ns + "ItemGroup",
750new XElement(ns + "Reference",
756var propertyGroup = new XElement(ns + "PropertyGroup");
757propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
822var itemGroup = new XElement(ns + "PropertyGroup");
823itemGroup.Add(new XElement(property.name, property.value));
WasmBuildLazyLoadTest.cs (20)
25var itemGroup = new XElement(ns + "ItemGroup");
26itemGroup.Add(new XElement("BlazorWebAssemblyLazyLoad",
30var propertyGroup = new XElement("PropertyGroup");
31propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
77var itemGroup = new XElement(ns + "ItemGroup");
78itemGroup.Add(new XElement("BlazorWebAssemblyLazyLoad",
82var propertyGroup = new XElement("PropertyGroup");
83propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
129var itemGroup = new XElement(ns + "ItemGroup");
130itemGroup.Add(new XElement("BlazorWebAssemblyLazyLoad",
134var propertyGroup = new XElement("PropertyGroup");
135propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
181var itemGroup = new XElement(ns + "ItemGroup");
182itemGroup.Add(new XElement("BlazorWebAssemblyLazyLoad",
186var propertyGroup = new XElement("PropertyGroup");
187propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
233var itemGroup = new XElement(ns + "ItemGroup");
234itemGroup.Add(new XElement("BlazorWebAssemblyLazyLoad",
254var itemGroup = new XElement(ns + "ItemGroup");
255itemGroup.Add(new XElement("BlazorWebAssemblyLazyLoad",
WasmJsModulesIntegrationTests.cs (16)
22var itemGroup = new XElement("PropertyGroup");
23var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
65var itemGroup = new XElement("PropertyGroup");
66var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
111var itemGroup = new XElement("PropertyGroup");
112var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
160var itemGroup = new XElement("PropertyGroup");
161var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
171var itemGroup = new XElement("PropertyGroup");
172var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
176document.Root.Add(new XElement("ItemGroup",
177new XElement("Content",
215document.Root.Add(new XElement("PropertyGroup",
216new XElement("WasmFingerprintAssets", false)));
282var itemGroup = new XElement("PropertyGroup");
283var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
WasmPublishIntegrationTest.cs (74)
26var itemGroup = new XElement(ns + "PropertyGroup");
27itemGroup.Add(new XElement("WasmFingerprintAssets", false));
65var itemGroup = new XElement(ns + "PropertyGroup");
66itemGroup.Add(new XElement("WasmFingerprintAssets", false));
117var itemGroup = new XElement(ns + "PropertyGroup");
118itemGroup.Add(new XElement("WasmFingerprintAssets", false));
133reference.Add(new XElement(
170var itemGroup = new XElement(ns + "PropertyGroup");
171itemGroup.Add(new XElement("WasmFingerprintAssets", false));
219var itemGroup = new XElement(ns + "PropertyGroup");
220itemGroup.Add(new XElement("WasmFingerprintAssets", false));
282var itemGroup = new XElement("PropertyGroup");
283itemGroup.Add(new XElement("WasmFingerprintAssets", false));
337var itemGroup = new XElement(ns + "PropertyGroup");
338itemGroup.Add(new XElement("StaticWebAssetBasePath", basePath));
339itemGroup.Add(new XElement("WasmFingerprintAssets", false));
399var itemGroup = new XElement(ns + "PropertyGroup");
400itemGroup.Add(new XElement("StaticWebAssetBasePath", basePath));
401itemGroup.Add(new XElement("WasmFingerprintAssets", false));
466var itemGroup = new XElement(ns + "PropertyGroup");
467itemGroup.Add(new XElement("PublishTrimmed", false));
468itemGroup.Add(new XElement("WasmFingerprintAssets", false));
536var itemGroup = new XElement(ns + "PropertyGroup");
537itemGroup.Add(new XElement("WasmFingerprintAssets", false));
547var propertyGroup = new XElement(ns + "PropertyGroup");
548propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
549propertyGroup.Add(new XElement("DefineConstants", @"$(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies"));
550var itemGroup = new XElement(ns + "ItemGroup");
551itemGroup.Add(new XElement("ProjectReference", new XAttribute("Include", @"..\classlibrarywithsatelliteassemblies\classlibrarywithsatelliteassemblies.csproj")));
588var itemGroup = new XElement(ns + "PropertyGroup");
589itemGroup.Add(new XElement("WasmFingerprintAssets", false));
681var itemGroup = new XElement(ns + "PropertyGroup");
682itemGroup.Add(new XElement("WasmFingerprintAssets", false));
723var itemGroup = new XElement(ns + "PropertyGroup");
724itemGroup.Add(new XElement("WasmFingerprintAssets", false));
735var propertyGroup = new XElement(ns + "PropertyGroup");
737propertyGroup.Add(new XElement("PublishTrimmed", false));
738propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
739propertyGroup.Add(new XElement("DefineConstants", @"$(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies"));
740var itemGroup = new XElement(ns + "ItemGroup");
741itemGroup.Add(new XElement("ProjectReference", new XAttribute("Include", @"..\classlibrarywithsatelliteassemblies\classlibrarywithsatelliteassemblies.csproj")));
784var propertyGroup = new XElement(ns + "PropertyGroup");
785propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
786propertyGroup.Add(new XElement("PublishTrimmed", false));
883var itemGroup = new XElement(ns + "PropertyGroup");
884itemGroup.Add(new XElement("WasmFingerprintAssets", false));
946var itemGroup = new XElement(ns + "PropertyGroup");
947itemGroup.Add(new XElement("WasmFingerprintAssets", false));
1039var itemGroup = new XElement(ns + "PropertyGroup");
1040itemGroup.Add(new XElement("WasmFingerprintAssets", false));
1141var itemGroup = new XElement(ns + "PropertyGroup");
1142itemGroup.Add(new XElement("WasmFingerprintAssets", false));
1152var propertyGroup = new XElement(ns + "PropertyGroup");
1153propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
1154propertyGroup.Add(new XElement("DefineConstants", @"$(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies"));
1155var itemGroup = new XElement(ns + "ItemGroup");
1156itemGroup.Add(new XElement("ProjectReference", new XAttribute("Include", @"..\classlibrarywithsatelliteassemblies\classlibrarywithsatelliteassemblies.csproj")));
1203var itemGroup = new XElement(ns + "PropertyGroup");
1204itemGroup.Add(new XElement("WasmFingerprintAssets", false));
1238var propertyGroup = new XElement(ns + "PropertyGroup");
1239propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
1262var itemGroup = new XElement(ns + "PropertyGroup");
1263itemGroup.Add(new XElement("WasmFingerprintAssets", false));
1288var itemGroup = new XElement(ns + "PropertyGroup");
1289itemGroup.Add(new XElement("WasmFingerprintAssets", false));
1472var itemGroup = new XElement(ns + "PropertyGroup");
1473itemGroup.Add(new XElement("WasmFingerprintAssets", false));
1474itemGroup.Add(new XElement("InvariantGlobalization", true));
1508var itemGroup = new XElement(ns + "PropertyGroup");
1509itemGroup.Add(new XElement("WasmFingerprintAssets", false));
1581var itemGroup = new XElement(ns + "ItemGroup",
1582new XElement(ns + "Reference",
1591var propertyGroup = new XElement("PropertyGroup");
1592propertyGroup.Add(new XElement("WasmFingerprintAssets", false));
Microsoft.NET.Sdk.Publish.Tasks (4)
Microsoft.NET.Sdk.Publish.Tasks.Tests (1)
Microsoft.NET.Sdk.Razor.Tests (14)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (49)
GenerateStaticWebAssetsPropsFile.cs (21)
62var itemGroup = new XElement("ItemGroup");
71itemGroup.Add(new XElement("StaticWebAsset",
73new XElement(SourceType, "Package"),
74new XElement(SourceId, element.GetMetadata(SourceId)),
75new XElement(ContentRoot, @$"$(MSBuildThisFileDirectory)..\{Normalize(PackagePathPrefix)}\"),
76new XElement(BasePath, element.GetMetadata(BasePath)),
77new XElement(RelativePath, relativePath),
78new XElement(AssetKind, element.GetMetadata(AssetKind)),
79new XElement(AssetMode, element.GetMetadata(AssetMode)),
80new XElement(AssetRole, element.GetMetadata(AssetRole)),
81new XElement(RelatedAsset, element.GetMetadata(RelatedAsset)),
82new XElement(AssetTraitName, element.GetMetadata(AssetTraitName)),
83new XElement(AssetTraitValue, element.GetMetadata(AssetTraitValue)),
84new XElement(Fingerprint, element.GetMetadata(Fingerprint)),
85new XElement(Integrity, element.GetMetadata(Integrity)),
86new XElement(CopyToOutputDirectory, element.GetMetadata(CopyToOutputDirectory)),
87new XElement(CopyToPublishDirectory, element.GetMetadata(CopyToPublishDirectory)),
88new XElement(FileLength, element.GetMetadata(FileLength)),
89new XElement(LastWriteTime, element.GetMetadata(LastWriteTime)),
90new XElement(OriginalItemSpec, fullPathExpression)));
94var root = new XElement("Project", itemGroup);
Legacy\GenerateStaticWebAssetsPropsFile50.cs (17)
56var itemGroup = new XElement("ItemGroup");
62itemGroup.Add(new XElement("StaticWebAsset",
64new XElement(SourceType, "Package"),
65new XElement(SourceId, element.GetMetadata(SourceId)),
66new XElement(ContentRoot, @$"$(MSBuildThisFileDirectory)..\{Normalize(PackagePathPrefix)}\"),
67new XElement(BasePath, element.GetMetadata(BasePath)),
68new XElement(RelativePath, element.GetMetadata(RelativePath)),
69new XElement(AssetKind, element.GetMetadata(AssetKind)),
70new XElement(AssetMode, element.GetMetadata(AssetMode)),
71new XElement(AssetRole, element.GetMetadata(AssetRole)),
72new XElement(RelatedAsset, element.GetMetadata(RelatedAsset)),
73new XElement(AssetTraitName, element.GetMetadata(AssetTraitName)),
74new XElement(AssetTraitValue, element.GetMetadata(AssetTraitValue)),
75new XElement(CopyToOutputDirectory, element.GetMetadata(CopyToOutputDirectory)),
76new XElement(CopyToPublishDirectory, element.GetMetadata(CopyToPublishDirectory)),
77new XElement(OriginalItemSpec, fullPathExpression)));
81var root = new XElement("Project", itemGroup);
Microsoft.NET.Sdk.StaticWebAssets.Tests (43)
StaticWebAssetEndpointsIntegrationTest.cs (16)
297new XElement("ItemGroup",
298new XElement("Content",
301new XElement("Content",
413var itemGroup = new XElement("PropertyGroup");
414var serviceWorkerAssetsManifest = new XElement("ServiceWorkerAssetsManifest", "service-worker-assets.js");
415var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
418itemGroup.Add(new XElement("WasmEnableHotReload", false));
440var itemGroup = new XElement("PropertyGroup");
441var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
443itemGroup.Add(new XElement("WasmEnableHotReload", false));
467var itemGroup = new XElement("PropertyGroup");
468var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
470itemGroup.Add(new XElement("WasmEnableHotReload", false));
493var itemGroup = new XElement("PropertyGroup");
494var fingerprintAssets = new XElement("WasmFingerprintAssets", false);
496itemGroup.Add(new XElement("WasmEnableHotReload", false));
Microsoft.NET.TestFramework (48)
ProjectConstruction\TestProject.cs (27)
185packageReferenceItemGroup = new XElement(ns + "ItemGroup");
192var packageReferenceElement = new XElement(ns + "PackageReference",
215packageReferenceItemGroup.Add(new XElement(ns + "DotNetCliToolReference",
226propertyGroup?.Add(new XElement(ns + "TargetFrameworks", TargetFrameworks));
230propertyGroup?.Add(new XElement(ns + "TargetFramework", TargetFrameworks));
235propertyGroup?.Add(new XElement(ns + "RuntimeFrameworkVersion", RuntimeFrameworkVersion));
240propertyGroup?.Add(new XElement(ns + "RuntimeIdentifier", RuntimeIdentifier));
247propertyGroup?.Add(new XElement(ns + "TargetFrameworkProfile", TargetFrameworkProfile));
266propertyGroup?.Add(new XElement(ns + additionalProperty.Key, additionalProperty.Value));
276additionalItemGroup = new XElement(ns + "ItemGroup");
279var item = new XElement(ns + additionalItem.Key);
297propertyGroup?.Add(new XElement(ns + "SelfContained", string.Equals(SelfContained, "true", StringComparison.OrdinalIgnoreCase) ? "true" : "false"));
306projectReferenceItemGroup = new XElement(ns + "ItemGroup");
311projectReferenceItemGroup.Add(new XElement(ns + "ProjectReference",
322referenceItemGroup = new XElement(ns + "ItemGroup");
328referenceItemGroup.Add(new XElement(ns + "Reference",
335var frameworkReferenceItemGroup = new XElement(ns + "ItemGroup");
339frameworkReferenceItemGroup.Add(new XElement(ns + "FrameworkReference",
348var target = new XElement(ns + "Target",
352var copyElement = new XElement(ns + "Copy",
376propertyGroup?.Add(new XElement(ns + "CustomAfterDirectoryBuildTargets", $"$(CustomAfterDirectoryBuildTargets);{customAfterDirectoryBuildTargetsPath.FullName}"));
377propertyGroup?.Add(new XElement(ns + "CustomAfterMicrosoftCommonCrossTargetingTargets", $"$(CustomAfterMicrosoftCommonCrossTargetingTargets);{customAfterDirectoryBuildTargetsPath.FullName}"));
379var customAfterDirectoryBuildTargets = new XDocument(new XElement(ns + "Project"));
381var target = new XElement(ns + "Target",
387var itemGroup = new XElement(ns + "ItemGroup");
393new XElement(ns + "LinesToWrite",
398new XElement(ns + "WriteLinesToFile",
Microsoft.NET.ToolPack.Tests (18)
Microsoft.VisualStudio.LanguageServices (14)
Snippets\SnippetExpansionClient.cs (14)
655declarations.Add(new XElement(
657new XElement(snippetNamespace + "ID", new XText(parameter.Name)),
658new XElement(snippetNamespace + "Default", new XText(parameterValues.GetValueOrDefault(parameter.Name, "")))));
667declarations.Add(new XElement(
669new XElement(snippetNamespace + "ID", new XText(PlaceholderSnippetField)),
670new XElement(snippetNamespace + "Default", new XText(""))));
685new XElement(
687new XElement(
690new XElement(
692new XElement(snippetNamespace + "Title", new XText(methodName)),
693new XElement(snippetNamespace + "Description", new XText(s_fullMethodCallDescriptionSentinel))),
694new XElement(
696new XElement(snippetNamespace + "Declarations", declarations.ToArray()),
697new XElement(
Microsoft.VisualStudio.LanguageServices.Implementation (3)
PresentationFramework-SystemXmlLinq (1)
Roslyn.Diagnostics.Analyzers (17)
SignalR.Client.FunctionalTestApp (2)
Stress.ApiService (2)
System.Private.DataContractSerialization (1)
System.Private.Xml.Linq (14)
Text.Analyzers (17)
XmlFileLogger (19)
xunit.console (2)
3326 references to XElement
aspire (67)
Aspire.Cli.Tests (26)
Aspire.Dashboard (2)
BuildBoss (16)
ConfigurationSchemaGenerator (6)
ConfigurationSchemaGenerator.Tests (8)
CustomEncryptorSample (4)
dotnet.Tests (10)
dotnet-svcutil-lib (47)
Shared\MSBuildProj.cs (45)
71private XElement ProjectNode { get; set; }
73private XElement _projectReferenceGroup;
74private XElement ProjectReferceGroup
80IEnumerable<XElement> refItems = this.ProjectNode.Elements("ProjectReference");
96private XElement _referenceGroup;
97private XElement ReferenceGroup
103IEnumerable<XElement> refItems = this.ProjectNode.Elements("Reference");
120private XElement _packageReferenceGroup;
121private XElement PacakgeReferenceGroup
127IEnumerable<XElement> refItems = this.ProjectNode.Elements("PackageReference");
189IEnumerable<XElement> targetFrameworkElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "PropertyGroup", "TargetFramework");
211IEnumerable<XElement> targetFrameworksElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "PropertyGroup", "TargetFrameworks");
245IEnumerable<XElement> runtimeIdentifierElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "PropertyGroup", "RuntimeIdentifier");
251IEnumerable<XElement> packageReferenceElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "ItemGroup", "PackageReference");
252foreach (XElement reference in packageReferenceElements)
268IEnumerable<XElement> toolReferenceElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "ItemGroup", "DotNetCliToolReference");
269foreach (XElement reference in toolReferenceElements)
281IEnumerable<XElement> projectReferenceElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "ItemGroup", "ProjectReference");
282foreach (XElement reference in projectReferenceElements)
291IEnumerable<XElement> binReferenceElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "ItemGroup", "Reference");
292foreach (XElement reference in binReferenceElements)
302XElement hintPath = reference.Element("HintPath");
303XElement path = reference.Element("Path");
429var ele = doc.Root?.Descendants(elementStr).FirstOrDefault();
442private static IEnumerable<XElement> GetGroupValues(XElement projectElement, string group, bool createOnMissing = false)
445IEnumerable<XElement> groups = projectElement.Elements(group);
450XElement propertyGroup = new XElement(group);
452return new XElement[] { propertyGroup };
459private static IEnumerable<XElement> GetSubGroupValues(XElement projectElement, XNamespace msbuildNS, string group, string subGroupName)
461IEnumerable<XElement> groups = GetGroupValues(projectElement, group);
462IEnumerable<XElement> subGroupValues = groups.Elements(msbuildNS + subGroupName);
466private static string GetItemValue(XElement reference, string itemName, bool throwIfMissing = false)
475XElement itemNameElement = null;
489public static bool TryGetItemIdentity(XElement itemName, out string itemIdentity)
503private static string GetItemIdentity(XElement itemName)
598XElement element = new XElement(propertyName, null);
600IEnumerable<XElement> existingElements = GetSubGroupValues(this.ProjectNode, _msbuildNS, "PropertyGroup", propertyName);
607IEnumerable<XElement> propertyGroupItems = GetGroupValues(this.ProjectNode, "PropertyGroup", createOnMissing: true);
608XElement propertyGroup = propertyGroupItems.First();
657IEnumerable<XElement> targetFrameworkElements = GetSubGroupValues(this.ProjectNode, _msbuildNS, "PropertyGroup", "TargetFramework");
660var targetFrameworkNode = targetFrameworkElements.Last();
665IEnumerable<XElement> targetFrameworksElements = GetSubGroupValues(this.ProjectNode, _msbuildNS, "PropertyGroup", "TargetFrameworks");
668var targetFrameworksNode = targetFrameworksElements.Last();
dotnet-user-jwts (4)
dotnet-user-secrets (4)
dotnet-watch.Tests (10)
EndToEnd.Tests (7)
IIS.FunctionalTests (16)
IIS.LongTests (10)
IIS.NewHandler.FunctionalTests (10)
IIS.NewShim.FunctionalTests (10)
IIS.ShadowCopy.Tests (6)
IIS.Tests (2)
IISExpress.FunctionalTests (20)
illink (2)
ILLink.Tasks (2)
KeyManagementSimulator (9)
Metrics (47)
Metrics.Legacy (47)
Microsoft.Arcade.Common (3)
Microsoft.AspNetCore.App.Analyzers.Test (9)
Microsoft.AspNetCore.App.UnitTests (1)
Microsoft.AspNetCore.Authentication.Test (26)
Microsoft.AspNetCore.CookiePolicy.Test (3)
Microsoft.AspNetCore.DataProtection (159)
Microsoft.AspNetCore.DataProtection.EntityFrameworkCore (4)
Microsoft.AspNetCore.DataProtection.StackExchangeRedis (4)
Microsoft.AspNetCore.DataProtection.Tests (165)
KeyManagement\DeferredKeyTests.cs (7)
25mockInternalKeyManager.Setup(o => o.DeserializeDescriptorFromKeyElement(It.IsAny<XElement>()))
26.Returns<XElement>(element =>
34var key = new Key(keyId, creationDate, activationDate, expirationDate, mockInternalKeyManager.Object, XElement.Parse(@"<node />"), new[] { encryptorFactory });
50var key = new Key(Guid.Empty, now, now, now, new Mock<IInternalXmlKeyManager>().Object, XElement.Parse(@"<node />"), new[] { encryptorFactory });
64mockKeyManager.Setup(o => o.DeserializeDescriptorFromKeyElement(It.IsAny<XElement>()))
65.Returns<XElement>(element =>
73var key = new Key(Guid.Empty, now, now, now, mockKeyManager.Object, XElement.Parse(@"<node />"), new[] { encryptorFactory });
KeyManagement\KeyEscrowServiceProviderExtensionsTests.cs (8)
36mockKeyEscrowSink.Setup(o => o.Store(It.IsAny<Guid>(), It.IsAny<XElement>()))
37.Callback<Guid, XElement>((keyId, element) =>
48sink.Store(new Guid("39974d8e-3e53-4d78-b7e9-4ff64a2a5d7b"), XElement.Parse("<theElement />"));
61mockKeyEscrowSink1.Setup(o => o.Store(It.IsAny<Guid>(), It.IsAny<XElement>()))
62.Callback<Guid, XElement>((keyId, element) =>
68mockKeyEscrowSink2.Setup(o => o.Store(It.IsAny<Guid>(), It.IsAny<XElement>()))
69.Callback<Guid, XElement>((keyId, element) =>
81sink.Store(new Guid("39974d8e-3e53-4d78-b7e9-4ff64a2a5d7b"), XElement.Parse("<theElement />"));
KeyManagement\XmlKeyManagerTests.cs (33)
23private static readonly XElement serializedDescriptor = XElement.Parse(@"
84XElement elementStoredInRepository = null;
95.Setup(o => o.StoreElement(It.IsAny<XElement>(), It.IsAny<string>()))
96.Callback<XElement, string>((el, friendlyName) =>
171XElement elementStoredInEscrow = null;
173XElement elementStoredInRepository = null;
184.Setup(o => o.StoreElement(It.IsAny<XElement>(), It.IsAny<string>()))
185.Callback<XElement, string>((el, friendlyName) =>
192.Setup(o => o.Store(It.IsAny<Guid>(), It.IsAny<XElement>()))
193.Callback<Guid, XElement>((innerKeyId, el) =>
599mockXmlRepository.Setup(o => o.GetAllElements()).Returns(XElement.Parse(xml).Elements().ToArray());
616XElement elementStoredInRepository = null;
620.Setup(o => o.StoreElement(It.IsAny<XElement>(), It.IsAny<string>()))
621.Callback<XElement, string>((el, friendlyName) =>
666XElement elementStoredInRepository = null;
670.Setup(o => o.StoreElement(It.IsAny<XElement>(), It.IsAny<string>()))
671.Callback<XElement, string>((el, friendlyName) =>
768.Setup(o => o.ImportFromXml(It.IsAny<XElement>()))
775.Setup(o => o.Decrypt(It.IsAny<XElement>()))
776.Returns<XElement>(element =>
785.Setup(o => o.Encrypt(It.IsAny<XElement>()))
787.Returns<XElement>(element => new EncryptedXmlInfo(element, typeof(IXmlDecryptor)));
850.Setup(o => o.ImportFromXml(It.IsAny<XElement>()))
857.Setup(o => o.Decrypt(It.IsAny<XElement>()))
858.Returns<XElement>(element =>
875var keyElement = XElement.Parse(@"
1007IReadOnlyCollection<XElement> IXmlRepository.GetAllElements() => [];
1008void IXmlRepository.StoreElement(XElement element, string friendlyName) => throw new InvalidOperationException();
1017IReadOnlyCollection<XElement> IXmlRepository.GetAllElements() => [];
1018void IXmlRepository.StoreElement(XElement element, string friendlyName) => throw new InvalidOperationException();
1024public IAuthenticatedEncryptorDescriptor ImportFromXml(XElement element)
Microsoft.AspNetCore.Http.Connections.Tests (7)
Microsoft.AspNetCore.Identity.InMemory.Test (4)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
Microsoft.AspNetCore.Mvc.FunctionalTests (10)
Microsoft.AspNetCore.OpenApi.SourceGenerators (24)
Microsoft.AspNetCore.Rewrite (20)
IISUrlRewrite\UrlRewriteFileParser.cs (13)
24var xmlRoot = xmlDoc.Descendants(RewriteTags.Rewrite).FirstOrDefault();
39private void ParseRules(XElement? rules, IList<IISUrlRewriteRule> result, bool global)
46foreach (var rule in rules.Elements(RewriteTags.Rule))
58private void ParseRuleAttributes(XElement rule, UrlRewriteRuleBuilder builder)
74var match = rule.Element(RewriteTags.Match);
80var action = rule.Element(RewriteTags.Action);
91private static void ParseMatch(XElement match, UrlRewriteRuleBuilder builder, PatternSyntax patternSyntax)
104private void ParseConditions(XElement? conditions, UrlRewriteRuleBuilder builder, PatternSyntax patternSyntax)
121foreach (var cond in adds)
127private void ParseCondition(XElement conditionElement, UrlRewriteRuleBuilder builder, PatternSyntax patternSyntax)
188private void ParseUrlAction(XElement urlAction, UrlRewriteRuleBuilder builder, bool stopProcessing)
253private static bool ParseBool(XElement element, string rewriteTag, bool defaultValue)
268private static TEnum ParseEnum<TEnum>(XElement element, string rewriteTag, TEnum defaultValue)
Microsoft.AspNetCore.Rewrite.Tests (1)
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (56)
XElementExtensions.cs (12)
10public static XElement RequiredElement(this XElement element, string name)
12var existing = element.Element(name);
21public static XElement GetOrAdd(this XElement element, string name)
23var existing = element.Element(name);
33public static XElement GetOrAdd(this XElement element, string name, string attribute, string attributeValue)
35var existing = element.Elements(name).FirstOrDefault(e => e.Attribute(attribute)?.Value == attributeValue);
45public static XElement AddAndGetInnerElement(this XElement element, string name, string attribute, string attributeValue)
47var innerElement = new XElement(name, new XAttribute(attribute, attributeValue));
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (7)
Microsoft.AspNetCore.SignalR.Tests (7)
Microsoft.Build.BuildCheck.UnitTests (1)
Microsoft.Build.CommandLine.UnitTests (1)
Microsoft.Build.Engine.OM.UnitTests (1)
Microsoft.Build.Engine.UnitTests (1)
Microsoft.Build.Framework.UnitTests (1)
Microsoft.Build.Tasks.Core (23)
Microsoft.Build.Tasks.UnitTests (3)
Microsoft.Build.Utilities.UnitTests (1)
Microsoft.Cci.Extensions (5)
Microsoft.CodeAnalysis (17)
Microsoft.CodeAnalysis.Analyzers (48)
Microsoft.CodeAnalysis.AnalyzerUtilities (47)
Microsoft.CodeAnalysis.BannedApiAnalyzers (47)
Microsoft.CodeAnalysis.CodeStyle (40)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp (8)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (44)
NavigateTo\NavigateToTests.cs (15)
78var content = XElement.Parse("""
99var content = XElement.Parse("""
1519=> TestAsync(testHost, Composition.FirstActiveAndVisible, XElement.Parse("""
1559=> TestAsync(testHost, Composition.FirstActiveAndVisible, XElement.Parse("""
1599=> TestAsync(testHost, Composition.FirstActiveAndVisible, XElement.Parse("""
1639=> TestAsync(testHost, Composition.FirstActiveAndVisible, XElement.Parse("""
1679=> TestAsync(testHost, Composition.FirstActiveAndVisible, XElement.Parse("""
1720var content = XElement.Parse("""
1747var content = XElement.Parse("""
1774var content = XElement.Parse("""
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (28)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (17)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (7)
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (24)
Workspaces\EditorTestWorkspace_Create.cs (5)
16=> Create(XElement.Parse(xmlDefinition), openDocuments, composition);
19XElement workspaceElement,
28XElement workspaceElement,
93var workspaceElement = CreateWorkspaceElement(language, compilationOptions, parseOptions, files, sourceGeneratedFiles, metadataReferences, extension, commonReferences, isMarkup);
108var workspaceElement = CreateWorkspaceElement(
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.Features (19)
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (11)
242var element = await DownloadFileAsync(serverPath, cancellationToken).ConfigureAwait(false);
250FileInfo databaseFileInfo, XElement element, CancellationToken cancellationToken)
422var element = await DownloadFileAsync(serverPath, cancellationToken).ConfigureAwait(false);
467FileInfo databaseFileInfo, XElement patchElement, Func<byte[]> getDatabaseBytes, CancellationToken cancellationToken)
491FileInfo databaseFileInfo, XElement patchElement, Func<byte[]> getDatabaseBytes, CancellationToken cancellationToken)
535private static void ParsePatchElement(XElement patchElement, out bool upToDate, out bool tooOld, out byte[]? patchBytes)
571private async Task<XElement> DownloadFileAsync(string serverPath, CancellationToken cancellationToken)
611private async Task<(XElement? element, TimeSpan delay)> TryDownloadFileAsync(IFileDownloader fileDownloader, CancellationToken cancellationToken)
644var element = XElement.Load(reader);
686private async Task<(bool succeeded, byte[]? contentBytes)> TryParseDatabaseElementAsync(XElement element, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol (17)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (4)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (47)
Microsoft.CodeAnalysis.PublicApiAnalyzers (47)
Microsoft.CodeAnalysis.ResxSourceGenerator (48)
Microsoft.CodeAnalysis.Test.Utilities (78)
Assert\AssertXml.cs (48)
31Equal(XElement.Parse(expected), XElement.Parse(actual), message: null, expectedValueSourcePath: null, expectedValueSourceLine: 0, expectedIsXmlLiteral: true);
34public static void Equal(XElement expected, XElement actual)
43XElement expectedRoot,
44XElement actualRoot,
64private static string GetXmlString(XElement node, bool expectedIsXmlLiteral)
90XElement expectedRoot,
91Tuple<XElement, XElement> firstMismatch,
139private static bool CheckEqual(XElement expectedRoot, XElement actualRoot, IEqualityComparer<XElement> shallowComparer, out Tuple<XElement, XElement> firstMismatch)
145Tuple<XElement, XElement> rootPair = new Tuple<XElement, XElement>(expectedRoot, actualRoot);
153Stack<Tuple<XElement, XElement>> stack = new Stack<Tuple<XElement, XElement>>();
158Tuple<XElement, XElement> pair = stack.Pop();
162XElement[] children1 = pair.Item1.Elements().ToArray();
163MultiDictionary<XElement, XElement> children2Dict = new MultiDictionary<XElement, XElement>(shallowComparer);
166foreach (XElement child in pair.Item2.Elements())
177HashSet<XElement> children2Used = new HashSet<XElement>(ReferenceEqualityComparer.Instance);
178foreach (XElement child1 in children1)
180XElement child2 = null;
181foreach (var candidate in children2Dict[child1])
197stack.Push(new Tuple<XElement, XElement>(child1, child2));
211private class ShallowElementComparer : IEqualityComparer<XElement>
213public static readonly IEqualityComparer<XElement> Instance = new ShallowElementComparer();
217public bool Equals(XElement element1, XElement element2)
227public int GetHashCode(XElement element)
236private class NameAndAttributeComparer : IEqualityComparer<XElement>
238public static readonly IEqualityComparer<XElement> Instance = new NameAndAttributeComparer();
242public bool Equals(XElement element1, XElement element2)
258public int GetHashCode(XElement element)
Syntax\XmlHelpers.cs (14)
49private static void AddNodeInfo(NodeInfo info, XElement xml)
61public static void AddInfo(SyntaxNode node, XElement xml)
66public static void AddInfo(SyntaxNodeOrToken node, XElement xml)
71public static void AddInfo(SyntaxToken node, XElement xml)
76public static void AddInfo(SyntaxTrivia node, XElement xml)
81public static void AddErrors(XElement xml)
98public static XElement ToXml(this SyntaxNodeOrToken node, SyntaxTree syntaxTree, XmlOptions options = null)
100XElement xml = null;
113public static XElement ToXml(this SyntaxNode node, SyntaxTree syntaxTree, XmlOptions options = null)
120XElement xml = null;
157public static XElement ToXml(this SyntaxToken token, SyntaxTree syntaxTree, XmlOptions options = null)
164XElement retVal = new XElement("Node",
210public static XElement ToXml(this SyntaxTrivia trivia, SyntaxTree syntaxTree, XmlOptions options = null)
217XElement retVal = new XElement("Node",
Microsoft.CodeAnalysis.VisualBasic (6)
Compilation\DocumentationComments\DocumentationCommentCompiler.Includes.vb (6)
273Dim element = DirectCast(node, XElement)
304Dim element = DirectCast(container, XElement)
431Private Shared Function ElementNameIs(element As XElement, name As String) As Boolean
441Private Function RewriteIncludeElement(includeElement As XElement, currentXmlFilePath As String, originatingSyntax As XmlNodeSyntax, <Out> ByRef commentMessage As String) As XNode()
511Dim loadedElements As XElement() = XmlUtilities.TrySelectElements(doc, xpathValue, errorMessage, invalidXPath)
579Private Function GetIncludeElementLocation(includeElement As XElement, ByRef currentXmlFilePath As String, ByRef originatingSyntax As XmlNodeSyntax) As Location
Microsoft.CodeAnalysis.Workspaces (57)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (5)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (11)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (66)
Workspaces\TestWorkspace_Create.cs (6)
16=> Create(XElement.Parse(xmlDefinition), openDocuments, composition);
19XElement workspaceElement,
28XElement workspaceElement,
41XElement workspaceElement,
106var workspaceElement = CreateWorkspaceElement(language, compilationOptions, parseOptions, files, sourceGeneratedFiles, metadataReferences, extension, commonReferences, isMarkup);
121var workspaceElement = CreateWorkspaceElement(
Workspaces\TestWorkspace_XmlConsumption.cs (33)
116XElement workspaceElement,
117XElement projectElement,
167foreach (var documentElement in documentElements)
181foreach (var sourceGeneratedDocumentElement in projectElement.Elements(DocumentFromSourceGeneratorElementName))
206foreach (var additionalDocumentElement in additionalDocumentElements)
221foreach (var analyzerConfigElement in analyzerConfigElements)
237private static ParseOptions GetParseOptions(XElement projectElement, string language, HostLanguageServices languageServices)
244private static ParseOptions GetParseOptionsWorker(XElement projectElement, string language, HostLanguageServices languageServices)
332private static DocumentationMode? GetDocumentationMode(XElement projectElement)
345private string GetAssemblyName(XElement projectElement, ref int projectId)
361private string GetLanguage(XElement projectElement)
381private string GetRootNamespace(CompilationOptions compilationOptions, XElement projectElement)
400XElement projectElement,
404var compilationOptionsElement = projectElement.Element(CompilationOptionsElementName);
410private CompilationOptions CreateCompilationOptions(string language, XElement compilationOptionsElement, ParseOptions parseOptions)
548XElement workspaceElement,
549XElement documentElement,
569var originalProject = workspaceElement.Elements(ProjectElementName).FirstOrDefault(p =>
618var optionsElement = documentElement.Element(ParseOptionsElementName);
682private static TestDocumentServiceProvider? GetDocumentServiceProvider(XElement documentElement)
699private string GetFileName(XElement documentElement, ref int documentId)
713private static IReadOnlyList<string> GetFolders(XElement documentElement)
729protected virtual (MetadataReference reference, ImmutableArray<byte> peImage) CreateMetadataReferenceFromSource(XElement projectElement, XElement referencedSource)
750private Compilation CreateCompilation(XElement referencedSource)
772foreach (var documentElement in documentElements)
799private IList<MetadataReference> CreateReferenceList(XElement element)
802foreach (var reference in element.Elements(MetadataReferenceElementName))
812foreach (var metadataReferenceFromSource in element.Elements(MetadataReferenceFromSourceElementName))
820private static IList<AnalyzerReference> CreateAnalyzerList(XElement projectElement)
823foreach (var analyzer in projectElement.Elements(AnalyzerElementName))
835private IList<MetadataReference> CreateCommonReferences(XElement element)
959private static void AssertNoChildText(XElement element)
Microsoft.CodeAnalysis.Workspaces.UnitTests (5)
Microsoft.DotNet.Arcade.Sdk (3)
Microsoft.DotNet.Build.Manifest (17)
Microsoft.DotNet.Build.Tasks.Feed.Tests (2)
Microsoft.DotNet.Build.Tasks.Installers (11)
Microsoft.DotNet.Build.Tasks.Packaging (2)
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Microsoft.DotNet.Build.Tasks.Workloads (6)
Microsoft.DotNet.MacOsPkg.Core (7)
Microsoft.DotNet.NuGetRepack.Tasks (10)
Microsoft.DotNet.NuGetRepack.Tests (2)
Microsoft.DotNet.PackageInstall.Tests (14)
Microsoft.DotNet.PackageTesting (4)
Microsoft.DotNet.SetupNugetSources.Tests (21)
Microsoft.DotNet.SharedFramework.Sdk (6)
Microsoft.DotNet.SignTool.Tests (3)
Microsoft.DotNet.SourceBuild.Tasks (17)
Microsoft.DotNet.XliffTasks (61)
Microsoft.DotNet.XliffTasks.Tests (11)
Microsoft.Extensions.AI.Abstractions.Tests (1)
Microsoft.Extensions.AI.Evaluation.Safety (2)
Microsoft.Extensions.FileProviders.Embedded (11)
Microsoft.Extensions.FileProviders.Embedded.Tests (1)
Microsoft.Maui.Resizetizer (22)
Microsoft.ML.Maml (2)
Microsoft.NET.Build.Extensions.Tasks (1)
Microsoft.NET.Build.Tasks (20)
Microsoft.NET.Build.Tasks.UnitTests (5)
Microsoft.NET.Build.Tests (168)
Microsoft.NET.Pack.Tests (11)
Microsoft.NET.Publish.Tests (31)
Microsoft.NET.Restore.Tests (3)
Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests (4)
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (2)
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (118)
Microsoft.NET.Sdk.Publish.Tasks (18)
WebConfigTransform.cs (17)
21XElement? rootElement = null;
24var firstAspNetCoreElement = webConfig.Root?.Descendants(aspNetCoreElementName).FirstOrDefault();
34var webServerSection = GetOrCreateChild(rootElement, "system.webServer");
36var handlerSection = GetOrCreateChild(webServerSection, HandlersElementName);
45var aspNetCoreSection = GetOrCreateChild(webServerSection, aspNetCoreElementName);
53var aspNetCoreElement = webServerSection?.Element(HandlersElementName)?
64private static void TransformHandlers(XElement handlersElement, string? aspNetCoreModuleName)
66var aspNetCoreElement =
89private static void TransformAspNetCore(XElement aspNetCoreElement, string appName, bool configureForAzure, bool useAppHost, string? extension, string? aspNetCoreModuleName, string? aspNetCoreHostingModelValue, string? projectFullPath)
171private static void SetAspNetCoreHostingModel(string? aspNetCoreHostingModelValue, string? aspNetCoreModuleName, XElement aspNetCoreElement)
194private static void TransformEnvironmentVariables(XElement envVariablesElement, string? environmentName)
196var envVariableElement =
210private static XElement GetOrCreateChild(XElement? parent, string childName)
212var childElement = parent?.Element(childName);
221private static void SetAttributeValueIfEmpty(XElement element, string attributeName, string? value)
226private static void RemoveLauncherArgs(XElement aspNetCoreElement)
Microsoft.NET.Sdk.Publish.Tasks.Tests (8)
Microsoft.NET.Sdk.Razor.Tests (7)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (10)
Microsoft.NET.Sdk.StaticWebAssets.Tests (30)
Microsoft.NET.TestFramework (39)
Microsoft.NET.ToolPack.Tests (15)
Microsoft.VisualStudio.LanguageServices (14)
Microsoft.VisualStudio.LanguageServices.CSharp (9)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
Microsoft.VisualStudio.LanguageServices.Implementation (13)
netstandard (1)
PresentationFramework-SystemXmlLinq (3)
Roslyn.Diagnostics.Analyzers (47)
Roslyn.Diagnostics.CSharp.Analyzers (2)
Roslyn.Test.PdbUtilities (29)
Reader\PdbValidation.cs (29)
33XElement expectedPdb,
79XElement expectedPdb,
96public static void VerifyPdb(this CompilationDifference diff, IEnumerable<MethodDefinitionHandle> methodHandles, XElement expectedPdb)
116XElement expectedPdb,
191XElement expectedPdb,
205XElement expectedPdb,
306var actualPdb = XElement.Parse(PdbToXmlConverter.ToXml(pdbStream, peStream, pdbToXmlOptions, methodName: qualifiedMethodName)).ToString();
345var actualConverted = AdjustForConversionArtifacts(XElement.Parse(PdbToXmlConverter.ToXml(pdbStreamConverted, peStreamOriginal, pdbToXmlOptions, methodName: qualifiedMethodName)).ToString());
361var xml = XElement.Parse(pdb);
362var pendingRemoval = new List<XElement>();
363foreach (var e in xml.DescendantsAndSelf())
385foreach (var e in pendingRemoval)
396var actualXml = XElement.Parse(actualPdb);
397var expectedXml = XElement.Parse(expectedPdb);
428private static bool RemoveElements(IEnumerable<XElement> elements)
432foreach (var e in array)
440private static void RemoveEmptyCustomDebugInfo(XElement pdb)
447private static void RemoveEmptyScopes(XElement pdb)
455private static void RemoveEmptySequencePoints(XElement pdb)
462private static void RemoveEmptyMethods(XElement pdb)
469private static void RemoveNonPortableElements(XElement expectedNativePdb)
493private static void RemoveElementsWithSpecifiedFormat(XElement expectedNativePdb, string format)
500private static void RemoveFormatAttributes(XElement pdb)
502foreach (var element in pdb.DescendantsAndSelf())
651var pdbXml = XElement.Parse(pdb);
RulesetToEditorconfigConverter (7)
sdk-tasks (3)
ServerComparison.FunctionalTests (1)
Shared.Tests (2)
SignalR.Client.FunctionalTestApp (7)
System.ComponentModel.TypeConverter (52)
MS\Internal\Xml\Linq\ComponentModel\XComponentModel.cs (52)
44if (typeof(T) == typeof(XElement))
144internal sealed class XElementAttributePropertyDescriptor : XPropertyDescriptor<XElement, object>
155return _value = new XDeferredSingleton<XAttribute>((e, n) => e.Attribute(n), (component as XElement)!, null);
196internal sealed class XElementDescendantsPropertyDescriptor : XPropertyDescriptor<XElement, IEnumerable<XElement>>
198private XDeferredAxis<XElement>? _value;
207return _value = new XDeferredAxis<XElement>((e, n) => n != null ? e.Descendants(n) : e.Descendants(), (component as XElement)!, null);
218XElement? e = sender as XElement;
225e = sender as XElement;
242XElement? e = sender as XElement;
249internal sealed class XElementElementPropertyDescriptor : XPropertyDescriptor<XElement, object>
251private XDeferredSingleton<XElement>? _value;
252private XElement? _changeState;
260return _value = new XDeferredSingleton<XElement>((e, n) => e.Element(n), (component as XElement)!, null);
270XElement? e = sender as XElement;
277e = sender as XElement;
285e = sender as XElement;
310XElement? e = sender as XElement;
317internal sealed class XElementElementsPropertyDescriptor : XPropertyDescriptor<XElement, IEnumerable<XElement>>
319private XDeferredAxis<XElement>? _value;
328return _value = new XDeferredAxis<XElement>((e, n) => n != null ? e.Elements(n) : e.Elements(), (component as XElement)!, null);
338XElement? e = sender as XElement;
345e = sender as XElement;
353e = sender as XElement;
370XElement? e = sender as XElement;
374e = sender as XElement;
381internal sealed class XElementValuePropertyDescriptor : XPropertyDescriptor<XElement, string>
383private XElement? _element;
396_element = component as XElement;
404_element = component as XElement;
418if (sender is XElement || sender is XText)
433internal sealed class XElementXmlPropertyDescriptor : XPropertyDescriptor<XElement, string>
435private XElement? _element;
443_element = component as XElement;
499private readonly Func<XElement, XName?, IEnumerable<T>> _func;
500internal XElement element;
503public XDeferredAxis(Func<XElement, XName?, IEnumerable<T>> func, XElement element, XName? name)
543private readonly Func<XElement, XName, T?> _func;
544internal XElement element;
547public XDeferredSingleton(Func<XElement, XName, T?> func, XElement element, XName? name)
System.Private.CoreLib.Generators (19)
NativeRuntimeEventSourceGenerator.cs (19)
46XElement? providerNode = manifest
132private static string GenerateEventSourceClass(XElement providerNode, string className, Dictionary<string, HashSet<string>> inclusionList)
159private static void GenerateKeywordsClass(XElement providerNode, StringWriter writer, Dictionary<string, HashSet<string>> inclusionList)
168XElement eventsNode = providerNode.Element(EventNs + "events");
174IEnumerable<XElement> eventNodes = eventsNode.Elements(EventNs + "event");
176foreach (XElement? eventNode in eventNodes)
195XElement? keywordsNode = providerNode.Element(EventNs + "keywords");
206foreach (XElement keywordNode in keywordsNode.Elements(EventNs + "keyword"))
222private static void GenerateEventMethods(XElement providerNode, StringWriter writer, Dictionary<string, HashSet<string>> inclusionList)
231XElement eventsNode = providerNode.Element(EventNs + "events");
238XElement templatesNode = providerNode.Element(EventNs + "templates");
239var templateDict = new Dictionary<string, XElement>();
242foreach (XElement? template in templatesNode.Elements(EventNs + "template"))
254foreach (XElement? eventNode in eventNodes)
274foreach (XElement? eventNode in eventNodes)
319&& templateDict.TryGetValue(templateValue, out XElement? template))
321IEnumerable<XElement> dataNodes = template.Elements(EventNs + "data").ToArray();
328foreach (XElement data in dataNodes)
345foreach (XElement data in dataNodes)
System.Private.DataContractSerialization (1)
System.Private.Xml.Linq (610)
System\Xml\Linq\Extensions.cs (126)
16/// Returns all of the <see cref="XAttribute"/>s for each <see cref="XElement"/> of
17/// this <see cref="IEnumerable"/> of <see cref="XElement"/>.
21/// Attributes for every <see cref="XElement"/> in the target <see cref="IEnumerable"/>
22/// of <see cref="XElement"/>.
24public static IEnumerable<XAttribute> Attributes(this IEnumerable<XElement?> source)
33/// <see cref="XElement"/>'s <see cref="XAttribute"/>s in the target <see cref="IEnumerable"/>
34/// of <see cref="XElement"/> are scanned for a matching <see cref="XName"/>.
38/// Attributes with a matching <see cref="XName"/> for every <see cref="XElement"/> in
39/// the target <see cref="IEnumerable"/> of <see cref="XElement"/>.
41public static IEnumerable<XAttribute> Attributes(this IEnumerable<XElement?> source, XName? name)
49/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent
50/// and it's parent up to the root) of each of the <see cref="XElement"/>s in this
51/// <see cref="IEnumerable"/> of <see cref="XElement"/>.
54/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent
55/// and it's parent up to the root) of each of the <see cref="XElement"/>s in this
56/// <see cref="IEnumerable"/> of <see cref="XElement"/>.
58public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T?> source) where T : XNode
66/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent
68/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
71/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent
73/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
75public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T?> source, XName? name) where T : XNode
79return name != null ? GetAncestors(source, name, false) : XElement.EmptySequence;
83/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the
84/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root).
85/// This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of
86/// <see cref="XElement"/>.
89/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the
90/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root).
91/// This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of
92/// <see cref="XElement"/>.
94public static IEnumerable<XElement> AncestorsAndSelf(this IEnumerable<XElement?> source)
102/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the
103/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root)
105/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
108/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the
109/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root)
111/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
113public static IEnumerable<XElement> AncestorsAndSelf(this IEnumerable<XElement?> source, XName? name)
117return name != null ? GetAncestors(source, name, true) : XElement.EmptySequence;
160/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children
161/// and their children down to the leaf level). This is done for each <see cref="XElement"/> in
162/// this <see cref="IEnumerable"/> of <see cref="XElement"/>.
165/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children
166/// and their children down to the leaf level). This is done for each <see cref="XElement"/> in
167/// this <see cref="IEnumerable"/> of <see cref="XElement"/>.
169public static IEnumerable<XElement> Descendants<T>(this IEnumerable<T?> source) where T : XContainer
177/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children
179/// for each <see cref="XElement"/> in the target <see cref="IEnumerable"/> of <see cref="XElement"/>.
182/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children
184/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
186public static IEnumerable<XElement> Descendants<T>(this IEnumerable<T?> source, XName? name) where T : XContainer
190return name != null ? GetDescendants(source, name, false) : XElement.EmptySequence;
194/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the
195/// <see cref="XElement"/> and it's descendants
197/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
200/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the
201/// <see cref="XElement"/> and descendants.
203/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
205public static IEnumerable<XNode> DescendantNodesAndSelf(this IEnumerable<XElement?> source)
213/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the
214/// <see cref="XElement"/> and it's descendants (children and children's children down
215/// to the leaf nodes). This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/>
216/// of <see cref="XElement"/>.
219/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the
220/// <see cref="XElement"/> and it's descendants (children and children's children down
221/// to the leaf nodes). This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/>
222/// of <see cref="XElement"/>.
224public static IEnumerable<XElement> DescendantsAndSelf(this IEnumerable<XElement?> source)
232/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the
233/// <see cref="XElement"/> and it's descendants (children and children's children down
235/// each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
238/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the
239/// <see cref="XElement"/> and it's descendants (children and children's children down
241/// each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
243public static IEnumerable<XElement> DescendantsAndSelf(this IEnumerable<XElement?> source, XName? name)
247return name != null ? GetDescendants(source, name, true) : XElement.EmptySequence;
251/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements
252/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
255/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements
256/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
258public static IEnumerable<XElement> Elements<T>(this IEnumerable<T?> source) where T : XContainer
266/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements
267/// with a matching for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
270/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements
271/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
273public static IEnumerable<XElement> Elements<T>(this IEnumerable<T?> source, XName? name) where T : XContainer
277return name != null ? GetElements(source, name) : XElement.EmptySequence;
281/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements
282/// with a matching for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
285/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements
286/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
341private static IEnumerable<XAttribute> GetAttributes(IEnumerable<XElement?> source, XName? name)
343foreach (XElement? e in source)
360private static IEnumerable<XElement> GetAncestors<T>(IEnumerable<T?> source, XName? name, bool self) where T : XNode
366XElement? e = (self ? node : node.parent) as XElement;
370e = e.parent as XElement;
404private static IEnumerable<XElement> GetDescendants<T>(IEnumerable<T?> source, XName? name, bool self) where T : XContainer
412XElement e = (XElement)root;
429XElement? e = n as XElement;
437private static IEnumerable<XElement> GetElements<T>(IEnumerable<T?> source, XName? name) where T : XContainer
449XElement? e = n as XElement;
System\Xml\Linq\XElement.cs (257)
26/// An <see cref="XElement"/> can contain the following types of content:
29/// <item><see cref="XElement"/></item>
41public static IEnumerable<XElement> EmptySequence
45return Array.Empty<XElement>();
106public XElement(XElement other)
162internal static async Task<XElement> CreateAsync(XmlReader r, CancellationToken cancellationToken)
164XElement xe = new XElement(default(AsyncConstructionSentry));
170/// Outputs this <see cref="XElement"/>'s underlying XML tree. The output can
175/// Output this <see cref="XElement"/> to a file.
180/// <see cref="XElement.Save(string, SaveOptions)"/>) enabling
194/// Output this <see cref="XElement"/> to a file.
240if (n is XElement) return true;
323/// Returns this <see cref="XElement"/> and all of it's ancestors up
329/// Returns this <see cref="XElement"/> and all of it's ancestors up to
334/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing all of
335/// this <see cref="XElement"/>'s ancestors up to the root node (including
336/// this <see cref="XElement"/>.
338public IEnumerable<XElement> AncestorsAndSelf()
344/// Returns the ancestor(s) of this <see cref="XElement"/> with the matching
345/// <see cref="XName"/>. If this <see cref="XElement"/>'s <see cref="XName"/>
347/// resulting <see cref="IEnumerable"/> or <see cref="XElement"/>.
354/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the
355/// ancestors of this <see cref="XElement"/> with a matching <see cref="XName"/>.
357public IEnumerable<XElement> AncestorsAndSelf(XName? name)
359return name != null ? GetAncestors(name, true) : XElement.EmptySequence;
363/// Returns the <see cref="XAttribute"/> associated with this <see cref="XElement"/> that has this
388/// Returns the <see cref="XAttribute"/> associated with this <see cref="XElement"/>. Optionally
392/// Returns all of the <see cref="XAttribute"/>s associated with this <see cref="XElement"/>.
397/// associated with this <see cref="XElement"/>.
405/// Returns the <see cref="XAttribute"/>(s) associated with this <see cref="XElement"/> that has the passed
407/// <seealso cref="XElement.Attributes()"/>
421/// Get the self and descendant nodes for an <see cref="XElement"/>
430/// Returns this <see cref="XElement"/> and all of it's descendants. Overloads allow
432/// of a descendant <see cref="XElement"/> to match.
435/// Returns this <see cref="XElement"/> and all of it's descendant <see cref="XElement"/>s
436/// as an <see cref="IEnumerable"/> of <see cref="XElement"/>.
437/// <seealso cref="XElement.DescendantsAndSelf()"/>
440/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing this <see cref="XElement"/>
443public IEnumerable<XElement> DescendantsAndSelf()
449/// Returns the descendants of this <see cref="XElement"/> that have a matching <see cref="XName"/>
450/// to the one passed in, including, potentially, this <see cref="XElement"/>.
451/// <seealso cref="XElement.DescendantsAndSelf(XName)"/>
454/// The <see cref="XName"/> of the descendant <see cref="XElement"/> that is being targeted.
457/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing all of the descendant
458/// <see cref="XElement"/>s that have this <see cref="XName"/>.
460public IEnumerable<XElement> DescendantsAndSelf(XName? name)
462return name != null ? GetDescendants(name, true) : XElement.EmptySequence;
466/// Returns the default <see cref="XNamespace"/> of an <see cref="XElement"/>
475/// Get the namespace associated with a particular prefix for this <see cref="XElement"/>
501XElement? e = this;
528e = e.parent as XElement;
544/// <see cref="XElement"/> and initializing it from a data source containing
550/// <seealso cref="XElement.Parse(string)"/>
553/// Create a new <see cref="XElement"/> based on the contents of the file
555/// <see cref="XElement.Parse(string)"/> to create an <see cref="XElement"/> from
558/// <seealso cref="XElement.Parse(string)"/>
567/// A URI string referencing the file to load into a new <see cref="XElement"/>.
570/// An <see cref="XElement"/> initialized with the contents of the file referenced
573public static XElement Load([StringSyntax(StringSyntaxAttribute.Uri)] string uri)
579/// Create a new <see cref="XElement"/> based on the contents of the file
592/// A string representing the URI of the file to be loaded into a new <see cref="XElement"/>.
598/// An <see cref="XElement"/> initialized with the contents of the file referenced
602public static XElement Load([StringSyntax(StringSyntaxAttribute.Uri)] string uri, LoadOptions options)
612/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using
617/// created <see cref="XElement"/>.
620/// A new <see cref="XElement"/> containing the contents of the passed in
623public static XElement Load(Stream stream)
629/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using
640/// created <see cref="XElement"/>.
646/// A new <see cref="XElement"/> containing the contents of the passed in
649public static XElement Load(Stream stream, LoadOptions options)
659/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using
670/// created <see cref="XElement"/>.
678/// A new <see cref="XElement"/> containing the contents of the passed in
681public static async Task<XElement> LoadAsync(Stream stream, LoadOptions options, CancellationToken cancellationToken)
694/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using
699/// created <see cref="XElement"/>.
702/// A new <see cref="XElement"/> containing the contents of the passed in
705public static XElement Load(TextReader textReader)
711/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using
722/// created <see cref="XElement"/>.
728/// A new <see cref="XElement"/> containing the contents of the passed in
731public static XElement Load(TextReader textReader, LoadOptions options)
741/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using
752/// created <see cref="XElement"/>.
760/// A new <see cref="XElement"/> containing the contents of the passed in
763public static async Task<XElement> LoadAsync(TextReader textReader, LoadOptions options, CancellationToken cancellationToken)
776/// Create a new <see cref="XElement"/> containing the contents of the
781/// <see cref="XElement"/>.
784/// A new <see cref="XElement"/> containing the contents of the passed
787public static XElement Load(XmlReader reader)
793/// Create a new <see cref="XElement"/> containing the contents of the
798/// <see cref="XElement"/>.
804/// A new <see cref="XElement"/> containing the contents of the passed
807public static XElement Load(XmlReader reader, LoadOptions options)
812XElement e = new XElement(reader, options);
819/// Create a new <see cref="XElement"/> containing the contents of the
824/// <see cref="XElement"/>.
832/// A new <see cref="XElement"/> containing the contents of the passed
835public static Task<XElement> LoadAsync(XmlReader reader, LoadOptions options, CancellationToken cancellationToken)
840return Task.FromCanceled<XElement>(cancellationToken);
844private static async Task<XElement> LoadAsyncInternal(XmlReader reader, LoadOptions options, CancellationToken cancellationToken)
848XElement e = new XElement(default(AsyncConstructionSentry));
859/// Parses a string containing XML into an <see cref="XElement"/>. Optionally
863/// Parses a string containing XML into an <see cref="XElement"/>.
869/// A string containing the XML to parse into an <see cref="XElement"/>.
872/// An <see cref="XElement"/> created from the XML string passed in.
874public static XElement Parse(string text)
880/// Parses a string containing XML into an <see cref="XElement"/> and optionally
894/// A string containing the XML to parse into an <see cref="XElement"/>.
900/// An <see cref="XElement"/> created from the XML string passed in.
902public static XElement Parse(string text, LoadOptions options)
915/// Removes content and attributes from this <see cref="XElement"/>.
916/// <seealso cref="XElement.RemoveAttributes"/>
926/// Removes that attributes of this <see cref="XElement"/>.
927/// <seealso cref="XElement.RemoveAll"/>
928/// <seealso cref="XElement.RemoveAttributes"/>
1032/// Output this <see cref="XElement"/> to the passed in <see cref="Stream"/>.
1037/// <see cref="XElement.Save(Stream, SaveOptions)"/>) enabling
1043/// The <see cref="Stream"/> to output this <see cref="XElement"/> to.
1051/// Output this <see cref="XElement"/> to a <see cref="Stream"/>.
1070/// Output this <see cref="XElement"/> to a <see cref="Stream"/>.
1094/// Output this <see cref="XElement"/> to the passed in <see cref="TextWriter"/>.
1099/// <see cref="XElement.Save(TextWriter, SaveOptions)"/>) enabling
1105/// The <see cref="TextWriter"/> to output this <see cref="XElement"/> to.
1113/// Output this <see cref="XElement"/> to a <see cref="TextWriter"/>.
1132/// Output this <see cref="XElement"/> to a <see cref="TextWriter"/>.
1156/// Output this <see cref="XElement"/> to an <see cref="XmlWriter"/>.
1171/// Output this <see cref="XElement"/> to an <see cref="XmlWriter"/>.
1201/// <seealso cref="XElement.SetElementValue"/>
1202/// <seealso cref="XElement.SetValue"/>
1241/// <seealso cref="XElement.SetAttributeValue"/>
1242/// <seealso cref="XElement.SetValue"/>
1257XElement? e = Element(name);
1278/// <seealso cref="XElement.SetAttributeValue"/>
1279/// <seealso cref="XElement.SetElementValue"/>
1296/// Write this <see cref="XElement"/> to the passed in <see cref="XmlWriter"/>.
1299/// The <see cref="XmlWriter"/> to write this <see cref="XElement"/> to.
1309/// Write this <see cref="XElement"/> to the passed in <see cref="XmlTextWriter"/>.
1312/// The <see cref="XmlTextWriter"/> to write this <see cref="XElement"/> to.
1325/// Cast the value of this <see cref="XElement"/> to a <see cref="string"/>.
1328/// If the <see cref="XElement"/> is a subtree (an <see cref="XElement"/>
1329/// that has <see cref="XElement"/> children. The concatenated string
1330/// value of all of the <see cref="XElement"/>'s text and descendants
1334/// The <see cref="XElement"/> to cast to a string.
1337/// The content of this <see cref="XElement"/> as a <see cref="string"/>.
1341public static explicit operator string?(XElement? element)
1348/// Cast the value of this <see cref="XElement"/> to a <see cref="bool"/>.
1351/// The <see cref="XElement"/> to cast to <see cref="bool"/>.
1354/// The content of this <see cref="XElement"/> as a <see cref="bool"/>.
1363public static explicit operator bool(XElement element)
1371/// Cast the value of this <see cref="XElement"/> to a <see cref="bool"/>?.
1374/// The <see cref="XElement"/> to cast to <see cref="bool"/>?.
1377/// The content of this <see cref="XElement"/> as a <see cref="bool"/>?.
1384public static explicit operator bool?(XElement? element)
1391/// Cast the value of this <see cref="XElement"/> to an <see cref="int"/>.
1394/// The <see cref="XElement"/> to cast to <see cref="int"/>.
1397/// The content of this <see cref="XElement"/> as a <see cref="int"/>.
1406public static explicit operator int(XElement element)
1414/// Cast the value of this <see cref="XElement"/> to an <see cref="int"/>?.
1417/// The <see cref="XElement"/> to cast to <see cref="int"/>?.
1420/// The content of this <see cref="XElement"/> as a <see cref="int"/>?.
1427public static explicit operator int?(XElement? element)
1434/// Cast the value of this <see cref="XElement"/> to an <see cref="uint"/>.
1437/// The <see cref="XElement"/> to cast to <see cref="uint"/>.
1440/// The content of this <see cref="XElement"/> as a <see cref="uint"/>.
1449public static explicit operator uint(XElement element)
1457/// Cast the value of this <see cref="XElement"/> to an <see cref="uint"/>?.
1460/// The <see cref="XElement"/> to cast to <see cref="uint"/>?.
1463/// The content of this <see cref="XElement"/> as a <see cref="uint"/>?.
1470public static explicit operator uint?(XElement? element)
1477/// Cast the value of this <see cref="XElement"/> to a <see cref="long"/>.
1480/// The <see cref="XElement"/> to cast to <see cref="long"/>.
1483/// The content of this <see cref="XElement"/> as a <see cref="long"/>.
1492public static explicit operator long(XElement element)
1500/// Cast the value of this <see cref="XElement"/> to a <see cref="long"/>?.
1503/// The <see cref="XElement"/> to cast to <see cref="long"/>?.
1506/// The content of this <see cref="XElement"/> as a <see cref="long"/>?.
1513public static explicit operator long?(XElement? element)
1520/// Cast the value of this <see cref="XElement"/> to an <see cref="ulong"/>.
1523/// The <see cref="XElement"/> to cast to <see cref="ulong"/>.
1526/// The content of this <see cref="XElement"/> as a <see cref="ulong"/>.
1535public static explicit operator ulong(XElement element)
1543/// Cast the value of this <see cref="XElement"/> to an <see cref="ulong"/>?.
1546/// The <see cref="XElement"/> to cast to <see cref="ulong"/>?.
1549/// The content of this <see cref="XElement"/> as a <see cref="ulong"/>?.
1556public static explicit operator ulong?(XElement? element)
1563/// Cast the value of this <see cref="XElement"/> to a <see cref="float"/>.
1566/// The <see cref="XElement"/> to cast to <see cref="float"/>.
1569/// The content of this <see cref="XElement"/> as a <see cref="float"/>.
1578public static explicit operator float(XElement element)
1586/// Cast the value of this <see cref="XElement"/> to an <see cref="float"/>?.
1589/// The <see cref="XElement"/> to cast to <see cref="float"/>?.
1592/// The content of this <see cref="XElement"/> as a <see cref="float"/>?.
1599public static explicit operator float?(XElement? element)
1606/// Cast the value of this <see cref="XElement"/> to a <see cref="double"/>.
1609/// The <see cref="XElement"/> to cast to <see cref="double"/>.
1612/// The content of this <see cref="XElement"/> as a <see cref="double"/>.
1621public static explicit operator double(XElement element)
1629/// Cast the value of this <see cref="XElement"/> to an <see cref="double"/>?.
1632/// The <see cref="XElement"/> to cast to <see cref="double"/>?.
1635/// The content of this <see cref="XElement"/> as a <see cref="double"/>?.
1642public static explicit operator double?(XElement? element)
1649/// Cast the value of this <see cref="XElement"/> to a <see cref="decimal"/>.
1652/// The <see cref="XElement"/> to cast to <see cref="decimal"/>.
1655/// The content of this <see cref="XElement"/> as a <see cref="decimal"/>.
1664public static explicit operator decimal(XElement element)
1672/// Cast the value of this <see cref="XElement"/> to an <see cref="decimal"/>?.
1675/// The <see cref="XElement"/> to cast to <see cref="decimal"/>?.
1678/// The content of this <see cref="XElement"/> as a <see cref="decimal"/>?.
1685public static explicit operator decimal?(XElement? element)
1692/// Cast the value of this <see cref="XElement"/> to a <see cref="DateTime"/>.
1695/// The <see cref="XElement"/> to cast to <see cref="DateTime"/>.
1698/// The content of this <see cref="XElement"/> as a <see cref="DateTime"/>.
1707public static explicit operator DateTime(XElement element)
1715/// Cast the value of this <see cref="XElement"/> to an <see cref="DateTime"/>?.
1718/// The <see cref="XElement"/> to cast to <see cref="DateTime"/>?.
1721/// The content of this <see cref="XElement"/> as a <see cref="DateTime"/>?.
1728public static explicit operator DateTime?(XElement? element)
1735/// Cast the value of this <see cref="XElement"/> to a <see cref="DateTimeOffset"/>.
1738/// The <see cref="XElement"/> to cast to <see cref="DateTimeOffset"/>.
1741/// The content of this <see cref="XElement"/> as a <see cref="DateTimeOffset"/>.
1750public static explicit operator DateTimeOffset(XElement element)
1758/// Cast the value of this <see cref="XElement"/> to an <see cref="DateTimeOffset"/>?.
1761/// The <see cref="XElement"/> to cast to <see cref="DateTimeOffset"/>?.
1764/// The content of this <see cref="XElement"/> as a <see cref="DateTimeOffset"/>?.
1771public static explicit operator DateTimeOffset?(XElement? element)
1778/// Cast the value of this <see cref="XElement"/> to a <see cref="TimeSpan"/>.
1781/// The <see cref="XElement"/> to cast to <see cref="TimeSpan"/>.
1784/// The content of this <see cref="XElement"/> as a <see cref="TimeSpan"/>.
1793public static explicit operator TimeSpan(XElement element)
1801/// Cast the value of this <see cref="XElement"/> to an <see cref="TimeSpan"/>?.
1804/// The <see cref="XElement"/> to cast to <see cref="TimeSpan"/>?.
1807/// The content of this <see cref="XElement"/> as a <see cref="TimeSpan"/>?.
1814public static explicit operator TimeSpan?(XElement? element)
1821/// Cast the value of this <see cref="XElement"/> to a <see cref="Guid"/>.
1824/// The <see cref="XElement"/> to cast to <see cref="Guid"/>.
1827/// The content of this <see cref="XElement"/> as a <see cref="Guid"/>.
1836public static explicit operator Guid(XElement element)
1844/// Cast the value of this <see cref="XElement"/> to an <see cref="Guid"/>?.
1847/// The <see cref="XElement"/> to cast to <see cref="Guid"/>?.
1850/// The content of this <see cref="XElement"/> as a <see cref="Guid"/>?.
1857public static explicit operator Guid?(XElement? element)
1872/// Generates a <see cref="XElement"/> from its XML representation.
1875/// The <see cref="XmlReader"/> stream from which the <see cref="XElement"/>
1888/// Converts a <see cref="XElement"/> into its XML representation.
1891/// The <see cref="XmlWriter"/> stream to which the <see cref="XElement"/>
1936private bool AttributesEqual(XElement e)
1960XElement? e = node as XElement;
1977private string? GetNamespaceOfPrefixInScope(string prefix, XElement? outOfScope)
1979XElement? e = this;
1993e = e.parent as XElement;
System.Xml.Linq (1)
System.Xml.XDocument (1)
Test.Utilities (7)
Text.Analyzers (47)
XmlFileLogger (22)
xunit.console (10)
ConsoleRunner.cs (5)
273XElement assembliesElement = null;
290foreach (var assemblyElement in results.Where(result => result != null))
297var assemblyElement = ExecuteAssembly(consoleLock, assembly, serialize, needsXml, parallelizeTestCollections, maxThreadCount, diagnosticMessages, noColor, appDomains, failSkips, stopOnFail, project.Filters, internalDiagnosticMessages);
318XElement ExecuteAssembly(object consoleLock,
335var assemblyElement = needsXml ? new XElement("assembly") : null;