338 references to XElement
aspire (25)
Projects\CSharpProjectFile.cs (11)
193var root = new XElement("Project", new XAttribute("Sdk", Sdk));
197root.Add(new XElement("PropertyGroup",
198Properties.Select(property => new XElement(property.Name, property.Value))));
203root.Add(new XElement("ItemGroup",
209root.Add(new XElement("ItemGroup",
215root.Add(new XElement("ItemGroup",
219root.Add(Imports.Select(import => new XElement("Import", new XAttribute("Project", import.ProjectPath))));
230var element = new XElement("PackageReference", new XAttribute("Include", packageReference.Name));
245var element = new XElement("ProjectReference", new XAttribute("Include", projectReference.ProjectPath));
256var element = new XElement("None", new XAttribute("Update", noneItem.Update));
273element.Add(new XElement(name, value.Value ? "true" : "false"));
Projects\IntegrationClosureBuilder.cs (7)
151new XElement("BaseOutputPath", CliPathHelper.EnsureTrailingSlash(Path.Combine(restoreDir, "bin"))),
152new XElement("BaseIntermediateOutputPath", CliPathHelper.EnsureTrailingSlash(intermediateOutputPath)),
153new XElement("MSBuildProjectExtensionsPath", "$(BaseIntermediateOutputPath)"),
154new XElement("RestoreRootConfigDirectory", restoreRootConfigDirectory),
155new XElement("RestoreConfigFile", string.Empty));
159propertyGroup.Add(new XElement("RestorePackagesPath", globalPackagesFolder));
162return new XDocument(new XElement("Project", propertyGroup));
aspire-tray (6)
src\Aspire.Tray\Common\MacTrayStartupSettings.cs (6)
31new XElement("key", "Label"), new XElement("string", Label),
32new XElement("key", "ProgramArguments"),
33new XElement("array", new[] { cliPath, "tray", "start", "--non-interactive", "--nologo" }
34.Select(argument => new XElement("string", argument))),
35new XElement("key", "RunAtLoad"), new XElement("true"))));
Aspire.Cli.EndToEnd.Tests (2)
Aspire.Cli.Tests (4)
Aspire.Hosting.Azure.Provisioning.Generators (3)
Aspire.Hosting.Dotnet (3)
Aspire.Hosting.Maui (7)
Aspire.Templates.Tests (2)
Aspire.Tray.Tests (7)
src\Aspire.Tray\Common\MacTrayStartupSettings.cs (6)
31new XElement("key", "Label"), new XElement("string", Label),
32new XElement("key", "ProgramArguments"),
33new XElement("array", new[] { cliPath, "tray", "start", "--non-interactive", "--nologo" }
34.Select(argument => new XElement("string", argument))),
35new XElement("key", "RunAtLoad"), new XElement("true"))));
dotnet-svcutil-lib (2)
dotnet-user-jwts (1)
dotnet-user-secrets (1)
GenerateDocumentationAndConfigFiles (8)
GenerateTemplateManifest (13)
TemplateRestorePlan.cs (11)
149new XElement("TargetFramework", parameters["Framework"]),
150new XElement("OutputType", "Exe"),
151new XElement("FileBasedProgram", "true")));
168project.Add(new XElement("ItemGroup", new XElement("PackageReference", new XAttribute("Include", name), new XAttribute("Version", value))));
171project.Element("PropertyGroup")!.Add(new XElement(name, value));
294project.Frameworks.Count > 0 ? new XElement("TargetFrameworks", string.Join(";", project.Frameworks)) : null,
295new XElement("EnableDefaultItems", "false"),
296new XElement("ManagePackageVersionsCentrally", "false"),
297new XElement("NuGetAudit", "false")));
303new XDocument(new XElement("Solution", Projects.Select(project =>
304new XElement("Project", new XAttribute("Path", $"{project.Name}/{project.Name}.csproj"))))).Save(solutionPath);
illink (3)
Infrastructure.Tests (49)
Hex1bNativePublishingTests.cs (19)
367new XElement("NuGetPackageId", "Hex1b"),
368new XElement("PathInPackage", pathInPackage),
369new XElement("DestinationSubPath", rid.Length == 0 ? pathInPackage : Path.GetFileName(pathInPackage)),
370new XElement("DestinationSubDirectory", rid.Length == 0 ? pathInPackage[..(pathInPackage.LastIndexOf('/') + 1)] : "")));
377new XElement("NuGetPackageId", "OtherPackage"),
378new XElement("PathInPackage", "native/OpenConsole.exe"),
379new XElement("RelativePath", "other/OpenConsole.exe"));
383new XElement("RelativePath", "%(DestinationSubDirectory)%(Filename)%(Extension)")),
389new XElement("RelativePath", "other/OpenConsole.exe")));
397new XElement("ImportDirectoryBuildProps", "false"),
398new XElement("ImportDirectoryBuildTargets", "false")),
401new XElement("TargetFramework", "net11.0"),
402new XElement("RuntimeIdentifier", rid),
403new XElement("PublishSingleFile", singleFile),
404new XElement("IncludeNativeLibrariesForSelfExtract", "true")),
406new XElement("Import", new XAttribute("Project", Path.Combine(RepoRoot.Path, "src", "Aspire.Hosting", "buildTransitive", "Aspire.Hosting.targets"))),
410new XElement("ItemGroup", new XElement("_ResolvedCopyLocalPublishAssets",
412new XElement("DestinationSubPath", "%(Filename)%(Extension)"),
413new XElement("DestinationSubDirectory", "")))),
ResourceGeneratorMetadataTests.cs (10)
67new XElement("PropertyGroup", configuration.Root!.Elements("PropertyGroup").Elements("ResxCodeGenerator").Select(property => new XElement(property))),
68new XElement("PropertyGroup", source.Root!.Elements("PropertyGroup").Elements("ResxCodeGenerator").Select(property => new XElement(property))),
70neutralResources.Concat(otherResources).Select(path => new XElement("EmbeddedResource", new XAttribute("Include", path))),
71designers.Concat(otherSources).Select(path => new XElement("Compile", new XAttribute("Include", path)))),
72new XElement("ItemGroup", source.Root.Elements("ItemGroup").Elements()
77settingsDesigner.Add(new XElement("DependentUpon", "Settings.settings"));
78settingsDesigner.Add(new XElement("DesignTime", "True"));
79settingsDesigner.Add(new XElement("AutoGen", "True"));
82linkedResource.Add(new XElement("Link", Path.Combine(resourceDirectory, "Linked.resx")));
83linkedResource.Add(new XElement("LogicalName", "Shared.Linked.resources"));
TemplateManifest\TemplateManifestBuildTargetTests.cs (5)
36new XElement("RepoRoot", root + Path.DirectorySeparatorChar),
37new XElement("IntermediateOutputPath", Path.Combine(intermediate, "unused", "..")),
38new XElement("ArtifactsShippingPackagesDir", Path.Combine(root, "artifacts", "packages") + Path.DirectorySeparatorChar)),
39new XElement("Target", new XAttribute("Name", "RefreshTemplatePackageInputsForCgManifest")),
40new XElement("Target", new XAttribute("Name", "ReplacePackageVersionOnTemplates")),
TemplateManifest\TemplateManifestTestEnvironment.cs (8)
57new XElement("package", new XAttribute("pattern", "*")))),
58new XElement("fallbackPackageFolders", new XElement("clear")))).Save(ConfigPath);
122new XDocument(new XElement("package",
124new XElement("id", name),
125new XElement("version", version),
126new XElement("authors", "Test"),
127new XElement("description", "Hermetic template manifest fixture"),
129new XElement("dependencies", dependencies.Select(dependency =>
Microsoft.AspNetCore.DataProtection (18)
KeyManagement\XmlKeyManager.cs (9)
389new XElement(RevocationDateElementName, revocationDate),
391new XElement(KeyElementName,
393new XElement(ReasonElementName, reason));
527new XElement(CreationDateElementName, creationDate),
528new XElement(ActivationDateElementName, activationDate),
529new XElement(ExpirationDateElementName, expirationDate),
634new XElement(RevocationDateElementName, revocationDate),
635new XElement(KeyElementName,
637new XElement(ReasonElementName, reason));
Microsoft.Build.Tasks.Core (5)
Microsoft.CodeAnalysis.Analyzers (8)
Microsoft.CodeAnalysis.AnalyzerUtilities (8)
Microsoft.CodeAnalysis.CodeStyle (8)
Microsoft.CodeAnalysis.ResxSourceGenerator (9)
Microsoft.CodeAnalysis.Workspaces (17)
Log\WorkspaceStructureLogger.cs (9)
80projectElement.Add(new XElement("workspaceDocuments", await CreateElementsForDocumentCollectionAsync(project.Documents, "document", cancellationToken).ConfigureAwait(false)));
81projectElement.Add(new XElement("workspaceAdditionalDocuments", await CreateElementsForDocumentCollectionAsync(project.AdditionalDocuments, "additionalDocuments", cancellationToken).ConfigureAwait(false)));
82projectElement.Add(new XElement("workspaceAnalyzerConfigDocuments", await CreateElementsForDocumentCollectionAsync(project.AnalyzerConfigDocuments, "analyzerConfigDocument", cancellationToken).ConfigureAwait(false)));
86projectElement.Add(new XElement("workspaceSourceGeneratedDocuments", CreateElementsForSourceGeneratedDocuments(sourceGeneratedDocuments)));
155var referenceElement = new XElement("projectReference", new XAttribute("id", SanitizePath(projectReference.ProjectId.ToString())));
259return new XElement("metadataReference", new XAttribute("display", SanitizePath(reference.Display)));
283typesElement.Add(new XElement("type", new XAttribute("name", type.ToDisplayString())));
301var documentElement = new XElement(elementName, new XAttribute("path", SanitizePath(document.FilePath)));
310documentElement.Add(new XElement("loadDiagnostic", loadDiagnostic));
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.Build.Manifest (1)
Microsoft.DotNet.Build.Tasks.Installers (5)
Microsoft.DotNet.Build.Tasks.Workloads (4)
Microsoft.DotNet.HotReload.Watch (1)
Microsoft.DotNet.SourceBuild.Tasks (6)
Microsoft.DotNet.XliffTasks (3)
Microsoft.Extensions.AI.Evaluation.Safety (3)
Microsoft.Extensions.FileProviders.Embedded.Manifest.Task (4)
Microsoft.Maui.Resizetizer (2)
Microsoft.ML.Maml (1)
Microsoft.NET.Build.Tasks (3)
Microsoft.NET.HostModel (2)
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (1)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (44)
GenerateStaticWebAssetsPropsFile.cs (19)
111new XElement(SourceType, emittedSourceType),
112new XElement(SourceId, element.GetMetadata(SourceId)),
113new XElement(ContentRoot, @$"$(MSBuildThisFileDirectory)..\{Normalize(PackagePathPrefix)}\"),
114new XElement(BasePath, element.GetMetadata(BasePath)),
115new XElement(RelativePath, relativePath),
116new XElement(AssetKind, element.GetMetadata(AssetKind)),
117new XElement(AssetMode, element.GetMetadata(AssetMode)),
118new XElement(AssetRole, element.GetMetadata(AssetRole)),
119new XElement(RelatedAsset, element.GetMetadata(RelatedAsset)),
120new XElement(AssetTraitName, element.GetMetadata(AssetTraitName)),
121new XElement(AssetTraitValue, element.GetMetadata(AssetTraitValue)),
122new XElement(Fingerprint, element.GetMetadata(Fingerprint)),
123new XElement(Integrity, element.GetMetadata(Integrity)),
124new XElement(CopyToOutputDirectory, element.GetMetadata(CopyToOutputDirectory)),
125new XElement(CopyToPublishDirectory, element.GetMetadata(CopyToPublishDirectory)),
126new XElement(FileLength, element.GetMetadata(FileLength)),
127new XElement(LastWriteTime, element.GetMetadata(LastWriteTime)),
128new XElement(OriginalItemSpec, fullPathExpression)));
132var root = new XElement("Project", itemGroup);
Legacy\GenerateStaticWebAssetsPropsFile50.cs (15)
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);
NuGet.Commands (12)
RestoreCommand\Utility\BuildAssetsUtils.cs (12)
138new XElement(Namespace + "Warning",
251return new XElement(Namespace + itemName, new XAttribute("Include", path));
266new XElement(Namespace + "NuGetPackageId", packageId),
267new XElement(Namespace + "NuGetPackageVersion", packageVersion),
268new XElement(Namespace + "NuGetItemType", item.BuildAction),
269new XElement(Namespace + "Pack", false));
283entry.Add(new XElement(Namespace + "CopyToOutputDirectory", "PreserveNewest"));
285entry.Add(new XElement(Namespace + "TargetPath", outputPath));
291entry.Add(new XElement(Namespace + "DestinationSubDirectory", destinationSubDirectory + Path.DirectorySeparatorChar));
296entry.Add(new XElement(Namespace + "Private", privateFlag.ToString(CultureInfo.CurrentCulture)));
306entry.Add(new XElement(Namespace + "Link", linkPath));
331var itemGroup = new XElement(Namespace + group.RootName, group.Items);
NuGet.Configuration (3)
NuGet.Packaging (22)
PackageCreation\Authoring\PackageBuilder.cs (6)
1240new XElement(dc + "creator", string.Join(", ", Authors)),
1241new XElement(dc + "description", Description),
1242new XElement(dc + "identifier", Id),
1243new XElement(core + "version", Version!.ToString()),
1245new XElement(core + "keywords", ((IPackageMetadata)this).Tags),
1247new XElement(core + "lastModifiedBy", CreatorInfo())
PackageCreation\Xml\PackageMetadataXmlExtensions.cs (15)
40elem.Add(new XElement(ns + "id", metadata.Id));
50elem.Add(new XElement(ns + "developmentDependency", metadata.DevelopmentDependency));
56elem.Add(new XElement(ns + "requireLicenseAcceptance", metadata.RequireLicenseAcceptance));
85elem.Add(new XElement(ns + "serviceable", metadata.Serviceable));
202return new XElement(ns + NuspecUtility.FrameworkReference, new XAttribute(NuspecUtility.Name, frameworkReference.Name));
207return new XElement(ns + Reference, new XAttribute(File, reference));
231return new XElement(ns + "dependency", attributes);
241return new XElement(
258return new XElement(ns + "contentFiles",
273return new XElement(ns + Files, attributes.Where(xAtt => xAtt != null));
314return new XElement(ns + NuspecUtility.Repository, attributeList);
342return new XElement(ns + NuspecUtility.PackageType, attributes.Where(xAtt => xAtt != null));
360parent.Add(new XElement(ns + name, value));
372parent.Add(new XElement(ns + name, processed));
384parent.Add(new XElement(ns + name, processed));
Roslyn.Diagnostics.Analyzers (8)
Stress.ApiService (1)
System.Private.Xml.Linq (2)