748 references to Attribute
aspire (63)
Packaging\NuGetConfigMerger.cs (36)
215var key = (string?)addElement.Attribute("key"); 216var value = (string?)addElement.Attribute("value"); 228.Select(e => (string?)e.Attribute("value") ?? string.Empty), StringComparer.OrdinalIgnoreCase); 230.Select(e => (string?)e.Attribute("key") ?? string.Empty), StringComparer.OrdinalIgnoreCase); 279var key = (string?)add.Attribute("key"); 280var value = (string?)add.Attribute("value"); 319var sourceKey = (string?)packageSourceElement.Attribute("key"); 330var pattern = (string?)packageElement.Attribute("pattern"); 404.FirstOrDefault(ps => string.Equals((string?)ps.Attribute("key"), keyToUse, StringComparison.OrdinalIgnoreCase)); 419.FirstOrDefault(p => string.Equals((string?)p.Attribute("pattern"), pattern, StringComparison.OrdinalIgnoreCase)); 445var pattern = (string?)packageElement.Attribute("pattern"); 467.FirstOrDefault(ps => string.Equals((string?)ps.Attribute("key"), keyToUse, StringComparison.OrdinalIgnoreCase)); 482.FirstOrDefault(p => string.Equals((string?)p.Attribute("pattern"), mapping.PackageFilter, StringComparison.OrdinalIgnoreCase)); 506var key = (string?)ps.Attribute("key"); 514var urlKey = (string?)elementToFix.Attribute("key"); 519.FirstOrDefault(ps => string.Equals((string?)ps.Attribute("key"), properKey, StringComparison.OrdinalIgnoreCase)); 528var pattern = (string?)packageToMove.Attribute("pattern"); 530.FirstOrDefault(p => string.Equals((string?)p.Attribute("pattern"), pattern, StringComparison.OrdinalIgnoreCase)); 566.Select(add => (string?)add.Attribute("key")) 574.Select(ps => (string?)ps.Attribute("key")) 589.FirstOrDefault(add => string.Equals((string?)add.Attribute("key"), sourceKey, StringComparison.OrdinalIgnoreCase)); 590var sourceValue = (string?)sourceElement?.Attribute("value"); 700var sourceKey = (string?)emptyElement.Attribute("key"); 716.FirstOrDefault(add => string.Equals((string?)add.Attribute("key"), sourceKey, StringComparison.OrdinalIgnoreCase) || 717string.Equals((string?)add.Attribute("value"), sourceKey, StringComparison.OrdinalIgnoreCase)); 761.Select(add => (string?)add.Attribute("key")) 768.Select(ps => (string?)ps.Attribute("key")) 781.FirstOrDefault(add => string.Equals((string?)add.Attribute("key"), sourceKey, StringComparison.OrdinalIgnoreCase)); 782var sourceValue = (string?)sourceElement?.Attribute("value"); 848.Select(e => (string?)e.Attribute("value") ?? string.Empty), StringComparer.OrdinalIgnoreCase); 850.Select(e => (string?)e.Attribute("key") ?? string.Empty), StringComparer.OrdinalIgnoreCase); 856var key = (string?)addElement.Attribute("key"); 857var value = (string?)addElement.Attribute("value"); 885var sourceKey = (string?)packageSourceElement.Attribute("key"); 894var pattern = (string?)packageElement.Attribute("pattern"); 982.FirstOrDefault(add => string.Equals((string?)add.Attribute("key"), "globalPackagesFolder", StringComparison.OrdinalIgnoreCase));
Packaging\PackageChannel.cs (1)
765.Select(element => element.Attribute("id")?.Value)
Projects\DotNetAppHostProject.cs (7)
375var projectAttributeValue = import.Attribute("Project")?.Value; 761var projectAttributeValue = import.Attribute("Project")?.Value; 998var projectAttributeValue = import.Attribute("Project")?.Value; 1260var sdkAttribute = root.Attribute("Sdk")?.Value; 1274&& string.Equals(e.Attribute("Name")?.Value, AspireAppHostSdkName, StringComparison.OrdinalIgnoreCase)); 1289&& string.Equals(e.Attribute("Sdk")?.Value, AspireAppHostSdkName, StringComparison.OrdinalIgnoreCase)); 1296&& string.Equals(e.Attribute("Include")?.Value,
Projects\FallbackProjectParser.cs (11)
146var usesAppHostSdk = DotNetAppHostProject.ContainsAspireAppHostSdk(root.Attribute("Sdk")?.Value ?? string.Empty) 149&& string.Equals(e.Attribute("Name")?.Value, "Aspire.AppHost.Sdk", StringComparison.OrdinalIgnoreCase)) 151&& DotNetAppHostProject.ContainsAspireAppHostSdk(e.Attribute("Sdk")?.Value ?? string.Empty))); 230var sdkAttribute = projectRoot.Attribute("Sdk")?.Value; 243.FirstOrDefault(e => e.Attribute("Name")?.Value == "Aspire.AppHost.Sdk"); 245return sdkElement?.Attribute("Version")?.Value; 286.Where(e => !string.IsNullOrEmpty(e.Attribute("Include")?.Value)); 290var identity = element.Attribute("Include")?.Value; 297var version = element.Attribute("Version")?.Value ?? 319.Where(e => !string.IsNullOrEmpty(e.Attribute("Include")?.Value)); 323var include = element.Attribute("Include")?.Value;
Projects\PrebuiltAppHostServer.cs (1)
539var include = element.Attribute("Include")?.Value;
Projects\ProjectUpdater.cs (7)
547&& ContainsAspireAppHostSdk(element.Attribute("Sdk")?.Value ?? string.Empty)) 549&& ((element.Name.LocalName == "Import" && ContainsAspireAppHostSdk(element.Attribute("Sdk")?.Value ?? string.Empty)) 550|| (element.Name.LocalName == "Sdk" && string.Equals(element.Attribute("Name")?.Value, AspireAppHostSdkName, StringComparison.OrdinalIgnoreCase))))); 553=> element.AncestorsAndSelf().All(node => string.IsNullOrWhiteSpace(node.Attribute("Condition")?.Value)); 563if (element.Name.LocalName == "Project" && element.Attribute("Sdk") is { } sdk && ContainsAspireAppHostSdk(sdk.Value)) 1422&& string.Equals(element.Attribute("Include")?.Value, package.Id, StringComparison.OrdinalIgnoreCase)).ToArray(); 1429if (versionElement is not null && reference.Attribute("Version") is null)
Aspire.Cli.EndToEnd.Tests (11)
CentralPackageManagementTests.cs (3)
324.Where(element => string.Equals((string?)element.Attribute("Include"), "Aspire.Hosting.Redis", StringComparison.Ordinal)); 328.Any(element => element.Attribute("Version") is not null); 330.Single().Attribute("Version") is not null;
EmulatedStagingBuildTests.cs (4)
266.Select(e => (string?)e.Attribute("value") ?? (string?)e.Attribute("key")) 277.Where(ps => ((string?)ps.Attribute("key"))?.Contains(feedFragment, StringComparison.OrdinalIgnoreCase) == true) 279.Any(p => string.Equals((string?)p.Attribute("pattern"), "Aspire*", StringComparison.OrdinalIgnoreCase));
Helpers\CliE2ETestHelpers.cs (3)
39.Where(reference => string.Equals(reference.Attribute("Include")?.Value, "Aspire.Hosting.AppHost", StringComparison.OrdinalIgnoreCase)) 40.Select(reference => reference.Attribute("Version")?.Value) 44var sdk = project.Root?.Attribute("Sdk")?.Value;
NewChannelNuGetConfigTests.cs (1)
77.Select(element => (string?)element.Attribute("value"))
Aspire.Cli.Tests (136)
AssemblyMetadataChannelTests.cs (1)
50(string?)e.Attribute("Condition"),
Commands\InitCommandTests.cs (3)
2347Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == channelSource); 2352.FirstOrDefault(ps => ps.Elements("package").Any(p => (string?)p.Attribute("pattern") == "Aspire*")); 2354Assert.Equal(channelSource, (string?)aspirePatternSource!.Attribute("key"));
Commands\NewCommandTests.cs (9)
731Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == sourceOverride); 732Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == PackageSources.NuGetOrg); 747.Where(e => string.Equals((string?)e.Attribute("key"), source, StringComparison.OrdinalIgnoreCase)) 749.Select(e => (string?)e.Attribute("pattern")) 1211.Any(package => (string?)package.Attribute("pattern") == "Aspire*")) 1212.Attribute("key"); 1216.Any(package => (string?)package.Attribute("pattern") == PackageMapping.AllPackages)) 1217.Attribute("key"); 2197.Select(element => (string)element.Attribute("value")!)
Commands\UpdateCommandRepositoryToolsTests.cs (5)
541Assert.Equal("Aspire.AppHost.Sdk/" + targetVersion, XDocument.Load(appHost.FullName).Root!.Attribute("Sdk")!.Value); 543Assert.Equal(targetVersion, packages.Single(package => package.Attribute("Include")!.Value == "Aspire.Hosting.Redis").Attribute("Version")!.Value); 544Assert.Equal("1.0.0", packages.Single(package => package.Attribute("Include")!.Value == "Unrelated.Package").Attribute("Version")!.Value);
Packaging\NuGetConfigMergerTests.cs (58)
75Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed1.example"); 76Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed2.example"); 116Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed2.example"); 120Assert.NotNull(psm.Elements("packageSource").First().Elements("package").FirstOrDefault(p => (string?)p.Attribute("pattern") == "Aspire.*")); 156Assert.DoesNotContain(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://old.example"); 158Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://new.example"); 162Assert.Equal("https://new.example", (string?)psm.Element("packageSource")!.Attribute("key")); 163Assert.Equal("Lib.*", (string?)psm.Element("packageSource")!.Element("package")!.Attribute("pattern")); 199Assert.DoesNotContain(packageSources.Elements("add"), e => (string?)e.Attribute("value") == stagingSource); 200Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == stableSource); 203Assert.DoesNotContain(packageSourceMapping.Elements("packageSource"), e => (string?)e.Attribute("key") == "aspire-staging"); 206Assert.Equal(stableSource, (string?)stableMapping.Attribute("key")); 207Assert.Equal("Aspire.*", (string?)stableMapping.Element("package")!.Attribute("pattern")); 351Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget" && (string?)e.Attribute("value") == "https://api.nuget.org/v3/index.json"); 352Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "dotnet9" && (string?)e.Attribute("value") == "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json"); 355Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-feed"); 359var nugetMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget"); 361Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 364var urlMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://api.nuget.org/v3/index.json"); 401Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget.org"); 402Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "custom"); 405Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-daily"); 417var aspireMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://example.com/aspire-daily"); 419Assert.Contains(aspireMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Aspire*"); 422var nugetMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget.org"); 424Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 426var customMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "custom"); 428Assert.Contains(customMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 470Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget.org"); 473Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-daily"); 483var nugetMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget.org"); 485Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 488var aspireMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://example.com/aspire-daily"); 490Assert.Contains(aspireMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Aspire*"); 491Assert.Contains(aspireMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Microsoft.Extensions.ServiceDiscovery*"); 535.FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget.org"); 537Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 541.FirstOrDefault(ps => (string?)ps.Attribute("key") == "github"); 543Assert.Contains(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "myorg.*"); 544Assert.Contains(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "other"); 545Assert.DoesNotContain(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 591e => (string?)e.Attribute("value") == "C:\\Users\\user\\.aspire\\hives\\invalid-pr"); 595e => (string?)e.Attribute("value") == "https://valid.example"); 599e => (string?)e.Attribute("value") == "https://api.nuget.org/v3/index.json"); 605ps => (string?)ps.Attribute("key") == "C:\\Users\\user\\.aspire\\hives\\invalid-pr"); 609.FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://valid.example"); 611Assert.Contains(validExampleMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "ValidPkg*"); 612Assert.DoesNotContain(validExampleMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 616.FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://api.nuget.org/v3/index.json"); 618Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Aspire*"); 619Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Microsoft.Extensions.ServiceDiscovery*"); 620Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 672e => string.Equals((string?)e.Attribute("value"), oldHive, StringComparison.Ordinal)); 674e => string.Equals((string?)e.Attribute("value"), newHive, StringComparison.Ordinal)); 678ps => string.Equals((string?)ps.Attribute("key"), oldHive, StringComparison.Ordinal)); 722e => string.Equals((string?)e.Attribute("value"), oldHive, StringComparison.Ordinal));
Packaging\PackagingServiceTests.cs (2)
1134.FirstOrDefault(add => string.Equals((string?)add.Attribute("key"), "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 1136var actualGlobalPackagesFolder = (string?)globalPackagesFolderAdd.Attribute("value");
Projects\AppHostServerProjectTests.cs (9)
264.FirstOrDefault(e => e.Attribute("Update")?.Value == "appsettings.json"); 267Assert.Equal("PreserveNewest", noneElement.Attribute("CopyToOutputDirectory")?.Value); 306element => element.Attribute("Include")?.Value == "Aspire.Hosting.Redis"); 308Assert.Equal("[13.1.0]", packageReference.Attribute("VersionOverride")?.Value); 309Assert.Null(packageReference.Attribute("Version")); 312element => element.Attribute("Include")?.Value == "Aspire.Hosting.PostgreSQL"); 334element => element.Attribute("Include")?.Value == integrationProjectPath); 339element => element.Attribute("Include")?.Value == "Aspire.Hosting.Redis"); 358.Select(element => element.Attribute("Include")?.Value)
Projects\PrebuiltAppHostServerTests.cs (26)
379Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "Aspire.Hosting" && e.Attribute("Version")?.Value == "13.2.0"); 380Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "Aspire.Hosting.Redis" && e.Attribute("Version")?.Value == "13.2.0"); 399Assert.Equal("/path/to/MyIntegration.csproj", projectElements[0].Attribute("Include")?.Value); 568.FirstOrDefault(element => element.Attribute("Name")?.Value == "_WriteAspireClosureManifest"); 571Assert.Equal("Build", target.Attribute("AfterTargets")?.Value); 572Assert.Equal("ResolveLockFileCopyLocalFiles", target.Attribute("DependsOnTargets")?.Value); 674Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "Aspire.Hosting.Redis" && e.Attribute("Version")?.Value == "[13.4.0-pr.17166.ga49d604d]"); 675Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "CommunityToolkit.Aspire.Hosting.Redis" && e.Attribute("Version")?.Value == "1.0.0"); 917.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 919var gpfValue = gpf.Attribute("value")?.Value; 976.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 978var gpfValue = gpf.Attribute("value")?.Value; 1097.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 1101var gpfValue = gpf.Attribute("value")?.Value; 2212e.Attribute("Include")?.Value == "Aspire.Hosting.Redis" && 2213e.Attribute("Version")?.Value == "13.4.0-pr.17141.gf142085f"); 2340Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "Aspire.Hosting.Redis" && e.Attribute("Version")?.Value == "[13.4.0-pr.17166.ga49d604d]"); 2341Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "CommunityToolkit.Aspire.Hosting.Redis" && e.Attribute("Version")?.Value == "1.0.0"); 3221.Where(e => string.Equals(e.Attribute("key")?.Value, source, StringComparison.OrdinalIgnoreCase)) 3223.Select(e => e.Attribute("pattern")?.Value)
Projects\ProjectUpdaterTests.cs (10)
129Assert.Equal("Aspire.AppHost.Sdk/17.0.0-preview.1", importedDocument.Root!.Attribute("Sdk")!.Value); 133Assert.Null(importedDocument.Root!.Attribute("Sdk")); 134Assert.All(importedDocument.Root.Elements().Where(element => element.Attribute("Condition") is null), 135element => Assert.Equal("17.0.0-preview.1", element.Attribute("Version")!.Value)); 140.Single(element => element.Attribute("Condition") is not null).Attribute("Version")!.Value); 254Assert.Equal("17.0.1-preview.1", cpm.Descendants("PackageVersion").Single().Attribute("Version")!.Value); 261Assert.Equal("17.0.1-preview.1", childVersion ? reference.Element("Version")!.Value : reference.Attribute("Version")!.Value); 264Assert.Null(reference.Attribute("Version")); 268Assert.Equal("8.2.1", props.Descendants("Import").Single().Attribute("Version")!.Value);
Templating\TemplateNuGetConfigServiceTests.cs (13)
62Assert.Contains(doc.Root!.Element("packageSources")!.Elements("add"), e => (string?)e.Attribute("value") == sourceOverride); 63Assert.Contains(doc.Root!.Element("packageSources")!.Elements("add"), e => (string?)e.Attribute("value") == PackageSources.NuGetOrg); 64Assert.DoesNotContain(doc.Descendants("add"), e => (string?)e.Attribute("value") == "https://private.example/v3/index.json"); 146Assert.Contains(doc.Root!.Element("packageSources")!.Elements("add"), e => (string?)e.Attribute("value") == "https://project.example/v3/index.json"); 147Assert.DoesNotContain(doc.Root!.Element("packageSources")!.Elements("add"), e => (string?)e.Attribute("value") == "https://parent.example/v3/index.json"); 335.Select(e => (string)e.Attribute("value")!) 394.Select(e => (string)e.Attribute("value")!) 515.Select(e => (string)e.Attribute("value")!) 1086.Where(e => string.Equals((string?)e.Attribute("key"), source, StringComparison.OrdinalIgnoreCase)) 1088.Select(e => (string?)e.Attribute("pattern")) 1127.Select(e => (string)e.Attribute("value")!) 1212.Select(e => (string)e.Attribute("value")!) 1270.Select(e => (string)e.Attribute("value")!)
Aspire.Dashboard (1)
Model\ResourceGraph\ResourceGraphMapper.cs (1)
99.Select(e => e.Attribute("d")?.Value ?? throw new InvalidOperationException($"Icon '{icon.Name}' contains an element without path data."))
Aspire.Dashboard.Tests (2)
Model\ResourceGraphMapperTests.cs (2)
183var expectedPathData = XElement.Parse(icon.Content).Attribute("d")!.Value; 195var expectedPaths = iconContent.Elements().Select(e => e.Attribute("d")!.Value).ToArray();
Aspire.Hosting.Azure.Provisioning.Generators (1)
AspireProvisioningProxyGenerator.cs (1)
2133string.Equals(element.Attribute("name")?.Value, parameter.SourceName, StringComparison.Ordinal))
Aspire.Hosting.Maui.Tests (11)
MauiEnvironmentHelperTests.cs (11)
48Assert.Equal("MY_VAR=hello", items[0].Attribute("Include")?.Value); 49Assert.Equal("OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317", items[1].Attribute("Include")?.Value); 64.FirstOrDefault(t => t.Attribute("Name")?.Value == "AspireGenerateAndroidEnvironmentFiles"); 66Assert.Equal("_GenerateEnvironmentFiles", target.Attribute("BeforeTargets")?.Value); 82Assert.Equal("$(IntermediateOutputPath)__aspire_environment__.txt", writeLines.Attribute("File")?.Value); 98.Select(item => item.Attribute("Include")?.Value) 141Assert.Equal("MY_VAR=hello", items[0].Attribute("Include")?.Value); 142Assert.Equal("OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317", items[1].Attribute("Include")?.Value); 157.FirstOrDefault(t => t.Attribute("Name")?.Value == "AspireLogMlaunchEnvironmentVariables"); 159Assert.Equal("PrepareForBuild", target.Attribute("AfterTargets")?.Value); 175.Select(item => item.Attribute("Include")?.Value)
Aspire.Hosting.RemoteHost (7)
AtsCapabilityScanner.cs (7)
3566.FirstOrDefault(m => string.Equals(m.Attribute("name")?.Value, memberName, StringComparison.Ordinal)); 3587.Select(param => param.Attribute("name")?.Value) 3631Name = param.Attribute("name")?.Value ?? string.Empty, 3714builder.Append(element.Attribute("name")?.Value); 3740var cref = element.Attribute("cref")?.Value; 3824var langword = element.Attribute("langword")?.Value; 3838var cref = element.Attribute("cref")?.Value;
Aspire.Templates.Tests (9)
BuildAndRunTemplateTests.cs (3)
100if (reference.Attribute("Version") is { } versionAttribute) 103new XAttribute("Include", reference.Attribute("Include")!.Value), 165.Where(reference => reference.Attribute("Include")?.Value == "Aspire.Hosting.AppHost")
NewUpAndBuildStandaloneTemplateTests.cs (3)
59.Where(element => element.Attribute("Include")?.Value != "Aspire.Hosting.Testing") 60.Select(element => $"{element.Attribute("Include")?.Value}/{element.Attribute("Version")?.Value}")
NewUpAndBuildSupportProjectTemplatesTests.cs (3)
69.Where(element => element.Attribute("Include")?.Value != "Aspire.Hosting.Testing") 70.Select(element => $"{element.Attribute("Include")?.Value}/{element.Attribute("Version")?.Value}")
Aspire.Tray.Tests (1)
MacTrayStartupSettingsTests.cs (1)
20Assert.Equal("1.0", xml.Root.Attribute("version")!.Value);
dotnet-svcutil-lib (2)
Shared\Utilities\RuntimeEnvironmentHelper.cs (2)
87.Select(e => e.Attribute("value").Value.TrimEnd(Path.DirectorySeparatorChar)) 95while (pkgSourcesNode.Elements("add").Any(e => StringComparer.OrdinalIgnoreCase.Compare(e.Attribute("key").Value, feedName) == 0))
GenerateDocumentationAndConfigFiles (19)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 148XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
GenerateTemplateManifest (6)
Program.cs (2)
159.Select(p => p.Attribute("pattern")!.Value) 206project.Project.Attribute("Sdk")!.Value.StartsWith("Microsoft.VisualStudio.JavaScript.Sdk/", StringComparison.Ordinal))
TemplateRestorePlan.cs (4)
198var relative = reference.Attribute("Include")!.Value.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 207foreach (var sdk in (project.Attribute("Sdk")?.Value ?? "").Split(';')) 267groups.SelectMany(g => g.Elements()).Any(e => e.Attribute("Update") is not null || e.Attribute("Remove") is not null) ||
ilc (9)
RdXmlRootProvider.cs (9)
57var assemblyNameAttribute = assemblyElement.Attribute("Name"); 65var dynamicDegreeAttribute = assemblyElement.Attribute("Dynamic"); 92var typeNameAttribute = typeElement.Attribute("Name"); 99var dynamicDegreeAttribute = typeElement.Attribute("Dynamic"); 108var marshalStructureDegreeAttribute = typeElement.Attribute("MarshalStructure"); 117var marshalDelegateDegreeAttribute = typeElement.Attribute("MarshalDelegate"); 141var methodNameAttribute = methodElement.Attribute("Name"); 152string paramName = element.Attribute("Name").Value; 156string instArgName = element.Attribute("Name").Value;
Infrastructure.Tests (65)
Hex1bNativePublishingTests.cs (9)
342(string?)import.Attribute("Project") == "$(MSBuildThisFileDirectory)src/Aspire.Hosting/buildTransitive/Aspire.Hosting.Hex1b.targets"); 344Assert.Contains(hostingTargets.Descendants("Import"), import => (string?)import.Attribute("Project") == "Aspire.Hosting.Hex1b.targets"); 347(string?)item.Attribute("Include") == @"buildTransitive\Aspire.Hosting.Hex1b.targets" && 348(string?)item.Attribute("Pack") == "true" && 349(string?)item.Attribute("PackagePath") == @"buildTransitive\$(DefaultTargetFramework)"); 357item => (string?)item.Attribute("Include") == "hex1bpty.exe"); 358Assert.Equal("3PartySHA2", (string?)helperCertificate.Attribute("CertificateName")); 361.Where(item => (string?)item.Attribute("Condition") == "$([System.OperatingSystem]::IsWindows())") 362.Select(item => (string?)item.Attribute("Include"))
NuGetConfigTests.cs (15)
19.ToDictionary(element => element.Attribute("key")!.Value, element => element.Attribute("value")!.Value, StringComparer.Ordinal); 26.ToDictionary(element => element.Attribute("key")!.Value, 27element => element.Elements("package").Select(package => package.Attribute("pattern")!.Value).ToArray(), 49Assert.Equal("nuget.org", (string?)source.Attribute("key")); 50Assert.Equal("https://data.nuget.org/v3/index.json", (string?)source.Attribute("value")); 56Assert.All(sources, source => AssertApprovedSource(source.Attribute("value")!.Value)); 58sources.Select(source => source.Attribute("key")!.Value).Order(StringComparer.Ordinal), 60.Select(source => source.Attribute("key")!.Value).Order(StringComparer.Ordinal)); 77element => (string?)element.Attribute("key") == "dotnet-tools"); 80(string?)source.Attribute("value")); 84element => (string?)element.Attribute("key") == "dotnet-tools"); 86.Select(element => element.Attribute("pattern")!.Value) 93element => (string?)element.Attribute("key") == "dotnet-public"); 95.Select(element => element.Attribute("pattern")!.Value);
Pipelines\NpmCliPackageTests.cs (5)
822(string?)element.Attribute("CollisionPriorityId") == collisionPriorityId && 823((string?)element.Attribute("Include") == include || (string?)element.Attribute("Update") == include) && 824(string?)element.Attribute("CertificateName") == certificateName && 825(string?)element.Attribute("Condition") == condition)
Pipelines\TrayBundleTests.cs (26)
128var dependencies = build.Attribute("DependsOnTargets")!.Value.Split(';', StringSplitOptions.TrimEntries); 130Assert.Equal("($(TargetRid.StartsWith('osx-')) or $(TargetRid.StartsWith('win-'))) and '$(SkipTrayBuild)' != 'true'", Target(project, "_PublishNativeTray").Attribute("Condition")!.Value); 131Assert.Equal("'$(SkipNativeBuild)' != 'true'", Target(project, "_PublishNativeCli").Attribute("Condition")!.Value); 136Assert.Contains("$(_CliPublishOutputArg)", Assert.Single(cliPublish.Elements("Exec")).Attribute("Command")!.Value); 143Assert.Equal("Publish", Target(project, "PackageTray").Attribute("AfterTargets")!.Value); 145Assert.Null(restore.Attribute("DependsOnTargets")); 146Assert.Contains(restore.Elements("Exec"), exec => exec.Attribute("Command")!.Value.StartsWith("ditto -xk", StringComparison.Ordinal)); 147Assert.Contains(restore.Elements("Exec"), exec => exec.Attribute("Command")!.Value.Contains("anchor apple generic", StringComparison.Ordinal)); 152.Select(element => element.Attribute("Include")!.Value) 156Assert.Equal("$(TraySigningArchive)", input.Attribute("Include")!.Value); 159Assert.Equal(input.Attribute("Include")!.Value, notarization.Attribute("Include")!.Value); 163Assert.Equal("ValidateTraySigning", signTray.Attribute("DependsOnTargets")!.Value); 165signTray.Elements("SignFiles").Select(task => task.Attribute("Files")!.Value)); 225Assert.Equal("_RunCreateLayout", verification.Attribute("AfterTargets")!.Value); 226Assert.Equal("$(TargetRid.StartsWith('osx-'))", verification.Attribute("Condition")!.Value); 227var command = Assert.Single(verification.Elements("Exec")).Attribute("Command")!.Value; 234Assert.Contains(solution.Descendants("Project"), entry => entry.Attribute("Path")?.Value == testProjectPath); 270exec => Assert.Contains("$(_OfficialBuildIdArg)", exec.Attribute("Command")!.Value)); 350element => element.Attribute("Include")?.Value == "aspire-tray.exe").Attribute("CertificateName")!.Value); 352element => element.Attribute("Include")?.Value == @"$(ArtifactsBinDir)Aspire.Tray.Windows\**\publish\aspire-tray.exe"); 355Assert.Equal("_RunCreateLayout", verify.Attribute("AfterTargets")!.Value); 356Assert.Equal("$(TargetRid.StartsWith('win-'))", verify.Attribute("Condition")!.Value); 358exec => Assert.Contains("verify-windows-tray-payload.ps1", exec.Attribute("Command")!.Value)); 470=> Assert.Single(project.Descendants("Target"), target => target.Attribute("Name")?.Value == name);
ResourceGeneratorMetadataTests.cs (2)
76.Single(item => item.Attribute("Include")?.Value == settingsDesignerPath); 81.Single(item => item.Attribute("Include")?.Value == otherResources[^1]);
TemplateManifest\TemplateManifestBuildTargetTests.cs (1)
42(string?)target.Attribute("Name") is "GenerateTemplateCgManifest" or "_CleanTemplateCgRestore")
TemplateManifest\TemplateManifestCacheTests.cs (1)
77var path = project.Attribute("Path")!.Value.Replace('/', Path.DirectorySeparatorChar);
TemplateManifest\TemplateRestorePlanTests.cs (6)
84.Select(p => p.Project.Descendants("PackageReference").Single().Attribute("Version")!.Value).Order()); 115Assert.Equal($"../{child.Name}/{child.Name}.csproj", parent.Project.Descendants("ProjectReference").Single().Attribute("Include")!.Value); 117Assert.Equal("all", parent.Project.Descendants("PackageReference").Single().Attribute("PrivateAssets")!.Value); 118Assert.Equal("Microsoft.AspNetCore.App", parent.Project.Descendants("FrameworkReference").Single().Attribute("Include")!.Value); 134Assert.Equal("'$(Mode)' == 'first'", normalized.Elements("PropertyGroup").Last().Attribute("Condition")!.Value); 264Assert.Equal("Additional", project.Project.Descendants("PackageReference").Single().Attribute("Include")!.Value);
Microsoft.AspNetCore.DataProtection (18)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializer.cs (2)
34configuration.EncryptionAlgorithm = (EncryptionAlgorithm)Enum.Parse(typeof(EncryptionAlgorithm), (string)encryptionElement.Attribute("algorithm")!); 40configuration.ValidationAlgorithm = (ValidationAlgorithm)Enum.Parse(typeof(ValidationAlgorithm), (string)validationElement.Attribute("algorithm")!);
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptorDeserializer.cs (5)
36configuration.EncryptionAlgorithm = (string)encryptionElement.Attribute("algorithm")!; 37configuration.EncryptionAlgorithmKeySize = (int)encryptionElement.Attribute("keyLength")!; 38configuration.EncryptionAlgorithmProvider = (string?)encryptionElement.Attribute("provider"); // could be null 41configuration.HashAlgorithm = (string)hashElement.Attribute("algorithm")!; 42configuration.HashAlgorithmProvider = (string?)hashElement.Attribute("provider"); // could be null
AuthenticatedEncryption\ConfigurationModel\CngGcmAuthenticatedEncryptorDescriptorDeserializer.cs (3)
35configuration.EncryptionAlgorithm = (string)encryptionElement.Attribute("algorithm")!; 36configuration.EncryptionAlgorithmKeySize = (int)encryptionElement.Attribute("keyLength")!; 37configuration.EncryptionAlgorithmProvider = (string?)encryptionElement.Attribute("provider"); // could be null
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorDescriptorDeserializer.cs (3)
35configuration.EncryptionAlgorithmType = ManagedAlgorithmHelpers.FriendlyNameToType((string)encryptionElement.Attribute("algorithm")!); 36configuration.EncryptionAlgorithmKeySize = (int)encryptionElement.Attribute("keyLength")!; 39configuration.ValidationAlgorithmType = ManagedAlgorithmHelpers.FriendlyNameToType((string)validationElement.Attribute("algorithm")!);
AuthenticatedEncryption\ConfigurationModel\XmlExtensions.cs (1)
17return ((bool?)element.Attribute(XmlConstants.RequiresEncryptionAttributeName)).GetValueOrDefault();
KeyManagement\XmlKeyManager.cs (3)
295Guid keyId = (Guid)keyElement.Attribute(IdAttributeName)!; 350string keyIdAsString = (string)revocationElement.Element(KeyElementName)!.Attribute(IdAttributeName)!; 577string descriptorDeserializerTypeName = (string)descriptorElement!.Attribute(DeserializerTypeAttributeName)!;
XmlEncryption\XmlEncryptionExtensions.cs (1)
50string decryptorTypeName = (string)clonedElementWhichRequiresDecryption.Attribute(XmlConstants.DecryptorTypeAttributeName)!;
Microsoft.AspNetCore.OpenApi.SourceGenerators (9)
XmlCommentGenerator.Parser.cs (1)
64var name = member.Attribute(DocumentationCommentXmlNames.NameAttributeName)?.Value;
XmlComments\XmlComment.cs (5)
76var rawListType = element.Attribute(DocumentationCommentXmlNames.TypeAttributeName)?.Value; 121var paramName = element.Attribute(DocumentationCommentXmlNames.NameAttributeName)?.Value; 136var paramName = element.Attribute(DocumentationCommentXmlNames.NameAttributeName)?.Value; 190var cref = item.Attribute(attributeName).Value; 222var langword = item.Attribute(attributeName).Value;
XmlComments\XmlComment.InheritDoc.cs (3)
144var crefAttribute = element.Attribute(XName.Get(DocumentationCommentXmlNames.CrefAttributeName)); 145var pathAttribute = element.Attribute(XName.Get(DocumentationCommentXmlNames.PathAttributeName)); 234if (typeParameterRef.Attribute(DocumentationCommentXmlNames.NameAttributeName) is XAttribute typeParamName)
Microsoft.AspNetCore.Rewrite (15)
IISUrlRewrite\RewriteMapParser.cs (3)
24var map = new IISRewriteMap(mapElement.Attribute(RewriteTags.Name)?.Value!); 27map[addElement.Attribute(RewriteTags.Key)!.Value.ToLowerInvariant()] = addElement.Attribute(RewriteTags.Value)!.Value;
IISUrlRewrite\UrlRewriteFileParser.cs (12)
60builder.Name = rule.Attribute(RewriteTags.Name)?.Value; 93var parsedInputString = match.Attribute(RewriteTags.Url)?.Value; 132var parsedInputString = conditionElement.Attribute(RewriteTags.Input)?.Value; 139var parsedPatternString = conditionElement.Attribute(RewriteTags.Pattern)?.Value; 200if (urlAction.Attribute(RewriteTags.Url) != null) 202url = urlAction.Attribute(RewriteTags.Url)!.Value; 227if (!int.TryParse(urlAction.Attribute(RewriteTags.StatusCode)?.Value, NumberStyles.None, CultureInfo.InvariantCulture, out statusCode)) 237if (!string.IsNullOrEmpty(urlAction.Attribute(RewriteTags.SubStatusCode)?.Value)) 242var statusReason = urlAction.Attribute(RewriteTags.StatusReason)?.Value; 243var statusDescription = urlAction.Attribute(RewriteTags.StatusDescription)?.Value; 256var attribute = element.Attribute(rewriteTag); 272var attribute = element.Attribute(rewriteTag);
Microsoft.AspNetCore.Server.IntegrationTesting (1)
xunit\IISExpressAncmSchema.cs (1)
46.Any(n => "hostingModel".Equals(n.Attribute("name")?.Value, StringComparison.Ordinal));
Microsoft.Build.Tasks.Core (12)
AssemblyDependency\GenerateBindingRedirects.cs (5)
240var name = assemblyIdentity.Attribute("name"); 241var publicKeyToken = assemblyIdentity.Attribute("publicKeyToken"); 250var culture = assemblyIdentity.Attribute("culture"); 253var oldVersionAttribute = bindingRedirect.Attribute("oldVersion"); 254var newVersionAttribute = bindingRedirect.Attribute("newVersion");
GenerateResource.cs (1)
3131string name = dataElem.Attribute("name").Value;
ResourceHandling\MSBuildResXReader.cs (6)
60string alias = elem.Attribute("alias")?.Value; 61string name = elem.Attribute("name").Value; 120string name = elem.Attribute("name").Value; 122bool preserve = elem.Attribute(XName.Get("space", "http://www.w3.org/XML/1998/namespace"))?.Value == "preserve"; 143string typename = elem.Attribute("type")?.Value; 144string mimetype = elem.Attribute("mimetype")?.Value;
Microsoft.CodeAnalysis (1)
RuleSet\RuleSetProcessor.cs (1)
255XAttribute attribute = node.Attribute(attributeName);
Microsoft.CodeAnalysis.Analyzers (20)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ResourceStringsFormat.cs (1)
78if (!(dataElement.Attribute("name")?.Value is { } name) ||
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 148XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
Microsoft.CodeAnalysis.AnalyzerUtilities (19)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 148XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
Microsoft.CodeAnalysis.CodeStyle (16)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
Microsoft.CodeAnalysis.CSharp (4)
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (4)
276XAttribute fileAttr = includeElement.Attribute(XName.Get(DocumentationCommentXmlNames.FileAttributeName)); 277XAttribute pathAttr = includeElement.Attribute(XName.Get(DocumentationCommentXmlNames.PathAttributeName)); 296XAttribute fileAttr = includeElement.Attribute(XName.Get(DocumentationCommentXmlNames.FileAttributeName)); 297XAttribute pathAttr = includeElement.Attribute(XName.Get(DocumentationCommentXmlNames.PathAttributeName));
Microsoft.CodeAnalysis.Features (3)
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (3)
407var rawListType = element.Attribute(DocumentationCommentXmlNames.TypeAttributeName)?.Value; 467var crefAttribute = element.Attribute(DocumentationCommentXmlNames.CrefAttributeName); 475var hrefAttribute = element.Attribute(DocumentationCommentXmlNames.HrefAttributeName);
Microsoft.CodeAnalysis.NetAnalyzers (3)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
51var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 52var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 147XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
Microsoft.CodeAnalysis.ResxSourceGenerator (20)
AbstractResxGenerator.cs (1)
446var name = node.Attribute("name")?.Value;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 148XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
Microsoft.CodeAnalysis.Workspaces (19)
Shared\Extensions\ISymbolExtensions.cs (3)
346var crefAttribute = element.Attribute(XName.Get(DocumentationCommentXmlNames.CrefAttributeName)); 347var pathAttribute = element.Attribute(XName.Get(DocumentationCommentXmlNames.PathAttributeName)); 428if (typeParameterRef.Attribute(DocumentationCommentXmlNames.NameAttributeName) is XAttribute typeParamName)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
Microsoft.DotNet.Arcade.Sdk (3)
src\ExtractNgenMethodList.cs (2)
64var flagsInt = child.Attribute("flagsInt"); 65var name = child.Attribute("name");
src\GenerateResxSource.cs (1)
112string name = node.Attribute("name")?.Value;
Microsoft.DotNet.Build.Manifest (1)
XElementParsingExtensions.cs (1)
15string value = element.Attribute(name)?.Value;
Microsoft.DotNet.Build.Tasks.Installers (8)
src\CreateWixBuildWixpack.cs (2)
579var source = element.Attribute(sourceAttr)?.Value; 631var id = element.Attribute(idAttr)?.Value;
src\GenerateMacOSDistributionFile.cs (3)
84.WithAttribute("id", c.Attribute("id").Value + ".alternate") 90.Select(c => new XElement("line", new XAttribute("choice", c.Attribute("id").Value))); 103if (optionsElement.Attribute("hostArchitectures") is null)
src\StabilizeWixFileId.cs (3)
77.Where(f => f.Attribute("Source")?.Value 90XAttribute nameAttribute = matchingFileElements[0].Attribute("Id"); 100matchingFileElements[0].Attribute("Source").Value);
Microsoft.DotNet.Build.Tasks.Packaging (2)
PackageIndex.cs (2)
219string assemblyName = file.Attribute("AssemblyName").Value; 220var versionAttribute = file.Attribute("Version");
Microsoft.DotNet.Build.Tasks.VisualStudio (2)
Vsix\FinalizeInsertionVsixFile.cs (2)
84var experimental = installationElement.Attribute("Experimental"); 93var systemComponent = installationElement.Attribute(systemComponentName);
Microsoft.DotNet.Build.Tasks.Workloads (1)
Msi\WixDocument.cs (1)
69if (element.Attribute("Id")?.Value == id)
Microsoft.DotNet.MacOsPkg.Core (1)
Package.cs (1)
203pkgInfo.Attribute(elementName)?.Value ?? throw new Exception($"{elementName} is required in PackageInfo");
Microsoft.DotNet.NuGetRepack.Tasks (3)
src\NuGetVersionUpdater.cs (3)
262var name = packageType.Attribute("name"); 288string id = dependency.Attribute("id")?.Value; 294var versionRangeAttribute = dependency.Attribute("version");
Microsoft.DotNet.SourceBuild.Tasks (10)
src\UsageReport\Usage.cs (4)
41AssetsFile = xml.Attribute("File")?.Value, 42IsDirectDependency = Convert.ToBoolean(xml.Attribute(nameof(IsDirectDependency))?.Value), 43IsAutoReferenced = Convert.ToBoolean(xml.Attribute(nameof(IsAutoReferenced))?.Value), 44RuntimePackageRid = xml.Attribute("Rid")?.Value
src\UsageReport\UsagePattern.cs (2)
22IdentityRegex = xml.Attribute(nameof(IdentityRegex))?.Value, 23IdentityGlob = xml.Attribute(nameof(IdentityGlob))?.Value
src\UsageReport\WriteUsageReports.cs (2)
93x.Attribute("Id")?.Value, 94x.Attribute("OriginBuildName")?.Value);
src\UsageReport\XmlParsingHelpers.cs (2)
27xml.Attribute("Id").Value, 28NuGetVersion.Parse(xml.Attribute("Version").Value));
Microsoft.DotNet.XliffTasks (22)
Model\ResxDocument.cs (4)
21if (node.Attribute("type") != null || node.Attribute("mimetype") != null) 26string name = node.Attribute("name").Value; 61if (node.Attribute("type")?.Value == "System.Resources.ResXFileRef, System.Windows.Forms")
Model\VsctDocument.cs (5)
22string id = strings.Parent.Attribute("id").Value; 27string guid = strings.Parent.Attribute("guid").Value; 66string id = strings.Parent.Attribute("id").Value; 81XAttribute hrefAttribute = imageTag.Attribute("href"); 89imageTag.Attribute("href").Value = absolutePath;
Model\XamlRuleDocument.cs (6)
53var localizableProperties = element.Attribute(XName.Get(LocalizedPropertiesAttributeName, XliffTasksNs))?.Value?.Split(';'); 155idBuilder.Append(element.Parent.Attribute("Name") is null ? XmlName(element.Parent) : $"{XmlName(element.Parent)}|{AttributedName(element.Parent)}"); 160if (element.Attribute("Name") is null) 174while (ancestorWithNameAttributeCandidate?.Attribute("Name") is null && ancestorWithNameAttributeCandidate?.Parent is not null) { 183idBuilder.Append(element.Attribute("Name") is not null ? AttributedName(element) : XmlName(element)); 220private static string? AttributedName(XElement element) => element.Attribute("Name")?.Value;
Model\XElementExtensions.cs (4)
40if (targetElement.Attribute("state") == null) 54transUnitElement.Element(Target)?.Attribute("state")?.Value 73XAttribute stateAttribute = targetElement.Attribute("state"); 136transUnitElement.Attribute("id").Value;
Model\XlfDocument.cs (1)
91XAttribute originalAttribute = fileElement.Attribute("original");
Tasks\TransformTemplates.cs (2)
86string projectFileFullPath = Path.Combine(templateDirectory, projectNode.Attribute("File").Value); 87File.Copy(TaskEnvironment.GetAbsolutePath(projectFileFullPath), TaskEnvironment.GetAbsolutePath(Path.Combine(localizedTemplateDirectory, Path.GetFileName(projectNode.Attribute("File").Value))), overwrite: true);
Microsoft.Extensions.FileProviders.Embedded (1)
Manifest\ManifestParser.cs (1)
128var value = element.Attribute("Name")?.Value;
Microsoft.Maui.Resizetizer (21)
GeneratePackageAppxManifest.cs (14)
92 var attr = identity.Attribute(xname); 103 var attr = identity.Attribute(xname); 201 var attr = visual.Attribute(xname); 209 var attr = visual.Attribute(xname); 218 var attr = visual.Attribute(xname); 228 var attr = visual.Attribute(xname); 240 var attr = visual.Attribute(xname); 264 var attr = tile.Attribute(xname); 276 var attr = tile.Attribute(xname); 288 var attr = tile.Attribute(xname); 302 var attr = tile.Attribute(xname); 319 if (showons.All(x => x.Attribute("Tile")?.Value != "square150x150Logo")) 321 if (showons.All(x => x.Attribute("Tile")?.Value != "wide310x150Logo")) 338 var attr = splash.Attribute(xname);
GenerateTizenManifest.cs (7)
145 if (icon.Attribute(DpiName) == null) 152 string dpiValue = icon.Attribute(DpiName).Value; 172 d => d.Attribute("type")?.Value == "img" 173 && d.Attribute(DpiName)?.Value == image.Key.Resolution 174 && d.Attribute("orientation")?.Value == image.Key.Orientation 175 && d.Attribute("indicator-display")?.Value == "false"); 192 var attr = element.Attribute(attrName);
Microsoft.NET.Build.Extensions.Tasks (3)
parent\Common\ConflictResolution\FrameworkListReader.cs (3)
68var type = file.Attribute("Type")?.Value; 75var assemblyName = file.Attribute("AssemblyName")?.Value; 76var assemblyVersionString = file.Attribute("Version")?.Value;
Microsoft.NET.Build.Tasks (26)
parent\Common\ConflictResolution\FrameworkListReader.cs (3)
68var type = file.Attribute("Type")?.Value; 75var assemblyName = file.Attribute("AssemblyName")?.Value; 76var assemblyVersionString = file.Attribute("Version")?.Value;
ResolveRuntimePackAssets.cs (11)
177string targetFrameworkVersion = frameworkListDoc.Root.Attribute("TargetFrameworkVersion")?.Value; 186(versionNumber >= 8 && frameworkListDoc.Root.Attribute("FrameworkName")?.Value == "Microsoft.Windows.SDK.NET.Ref")) 196var profileAttributeValue = fileElement.Attribute("Profile")?.Value; 207string pathAttributeValue = fileElement.Attribute("Path").Value; 212string typeAttributeValue = fileElement.Attribute("Type").Value; 230culture = fileElement.Attribute("Culture")?.Value; 233throw new BuildErrorException($"Culture not set in runtime manifest for {Path.GetFullPath(Path.Combine(runtimePack.GetMetadata(MetadataKeys.PackageDirectory), fileElement.Attribute("Path").Value))}"); 256assetItem.SetMetadata("AssemblyVersion", fileElement.Attribute("AssemblyVersion")?.Value); 257assetItem.SetMetadata("FileVersion", fileElement.Attribute("FileVersion")?.Value); 258assetItem.SetMetadata("PublicKeyToken", fileElement.Attribute("PublicKeyToken")?.Value); 259assetItem.SetMetadata("DropFromSingleFile", fileElement.Attribute("DropFromSingleFile")?.Value);
ResolveTargetingPackAssets.cs (10)
380var profileAttributeValue = fileElement.Attribute("Profile")?.Value; 396string referencedByDefaultAttributeValue = fileElement.Attribute("ReferencedByDefault")?.Value; 404string itemType = fileElement.Attribute("Type")?.Value; 407string assemblyName = fileElement.Attribute("AssemblyName").Value; 410Path.Combine(definition.TargetingPackRoot.OriginalValue, fileElement.Attribute("Path").Value) : 416item.SetMetadata("AssemblyVersion", fileElement.Attribute("AssemblyVersion").Value); 417item.SetMetadata("FileVersion", fileElement.Attribute("FileVersion").Value); 418item.SetMetadata("PublicKeyToken", fileElement.Attribute("PublicKeyToken").Value); 422string itemLanguage = fileElement.Attribute("Language")?.Value; 466string assemblyName = firstFileElement.Attribute("AssemblyName").Value;
StoreArtifactParser.cs (2)
31var pkgname = pkginfo.Attribute("Id"); 32var version = pkginfo.Attribute("Version");
Microsoft.NET.ProjectData (9)
FrameworkListExpander.cs (3)
84 string? type = (string?)file.Attribute("Type"); 85 string? path = (string?)file.Attribute("Path"); 96 string? language = (string?)file.Attribute("Language");
SdkKnownFrameworkReferenceResolver.cs (6)
89 string? targetFramework = (string?)element.Attribute("TargetFramework"); 90 string? targetingPackName = (string?)element.Attribute("TargetingPackName"); 91 string? targetingPackVersion = (string?)element.Attribute("TargetingPackVersion"); 105 string? targetFramework = (string?)element.Attribute("TargetFramework"); 106 string? packageId = (string?)element.Attribute("Include"); 107 string? packageVersion = (string?)element.Attribute(versionMetadataName);
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (3)
BlazorReadSatelliteAssemblyFile.cs (3)
28var taskItem = new TaskItem(e.Attribute("Name").Value); 29taskItem.SetMetadata("Culture", e.Attribute("Culture").Value); 30taskItem.SetMetadata("DestinationSubDirectory", e.Attribute("DestinationSubDirectory").Value);
Microsoft.NET.Sdk.Publish.Tasks (8)
WebConfigTransform.cs (8)
42.FirstOrDefault(e => string.Equals((string?)e.Attribute("name"), "aspnetcore", StringComparison.OrdinalIgnoreCase))? 43.Attribute("modules"); 68.FirstOrDefault(e => string.Equals((string?)e.Attribute("name"), "aspnetcore", StringComparison.OrdinalIgnoreCase)); 113var argumentsAttribute = aspNetCoreElement.Attribute("arguments"); 144var hostingModelAttributeValue = aspNetCoreElement.Attribute("hostingModel"); 198.FirstOrDefault(e => string.Equals((string?)e.Attribute("name"), "ASPNETCORE_ENVIRONMENT", StringComparison.OrdinalIgnoreCase)); 223element.SetAttributeValue(attributeName, (string?)element.Attribute(attributeName) ?? value); 228var arguments = (string?)aspNetCoreElement.Attribute("arguments");
Microsoft.NET.Sdk.StaticWebAssets.Tasks (4)
Legacy\GenerateV1StaticWebAssetsManifest.cs (4)
120if (!nodes.Exists(e => e.Attribute("BasePath").Value.Equals(normalizedBasePath, StringComparison.OrdinalIgnoreCase) && 121e.Attribute("Path").Value.Equals(normalizedContentRoot, StringComparison.OrdinalIgnoreCase))) 130return nodes.OrderBy(e => e.Attribute(BasePath).Value).ThenBy(e => e.Attribute(NodePath).Value);
Microsoft.TestPlatform.TestHostRuntimeProvider (2)
Hosting\AppxManifestFile.cs (1)
27Attribute("Executable")!.Value;
Hosting\DefaultTestHostManager.cs (1)
594Attribute("Include")!.Value;
NuGet.Configuration (12)
Settings\Items\FileClientCertItem.cs (3)
56var path = element.Attribute(XName.Get(ConfigurationConstants.PathAttribute))?.Value; 57var password = element.Attribute(XName.Get(ConfigurationConstants.PasswordAttribute))?.Value; 58var clearTextPassword = element.Attribute(XName.Get(ConfigurationConstants.ClearTextPasswordAttribute))?.Value;
Settings\Items\StoreClientCertItem.cs (4)
75var storeLocation = element.Attribute(XName.Get(ConfigurationConstants.StoreLocationAttribute))?.Value; 83var storeName = element.Attribute(XName.Get(ConfigurationConstants.StoreNameAttribute))?.Value; 91var findBy = element.Attribute(XName.Get(ConfigurationConstants.FindByAttribute))?.Value; 99var findValue = element.Attribute(XName.Get(ConfigurationConstants.FindValueAttribute))?.Value;
Settings\SettingElement.cs (3)
260var attribute = element.Attribute(requireAttribute); 274var attribute = element.Attribute(attributeValues.Key); 288var attribute = element.Attribute(attributeValues.Key);
Utility\XElementUtility.cs (2)
14var attr = element.Attribute(localName); 20var attr = element.Attribute(XName.Get(localName, namespaceName));
NuGet.PackageManagement (4)
Utility\XElementExtensions.cs (4)
23attr = element.Attribute(localName); 27attr = element.Attribute(XName.Get(localName, namespaceName)); 65where AttributeEquals(e, target.Attribute(e.Name)) 123var sourceAttribute = source.Attribute(targetAttribute.Name);
NuGet.Packaging (31)
Core\NuspecCoreReader.cs (2)
42var versionNode = node.Attribute(XName.Get(Version)); 51yield return new PackageDependency(node.Attribute(XName.Get(Id))!.Value, range);
Core\NuspecCoreReaderBase.cs (1)
104var node = MetadataNode.Attribute(XName.Get(MinClientVersion));
Core\NuspecUtility.cs (3)
73var nameAttribute = node.Attribute(XName.Get(Name)); 83var versionAttribute = node.Attribute(XName.Get(Version)); 182var attribute = element.Attribute(XName.Get(attributeName));
NuspecReader.cs (3)
440var type = licenseNode.Attribute(NuspecUtility.Type)?.Value?.Trim(); 442var versionValue = licenseNode.Attribute(NuspecUtility.Version)?.Value?.Trim(); 629var attribute = element.Attribute(XName.Get(attributeName));
PackageCreation\Authoring\ManifestReader.cs (16)
41manifestMetadata.MinClientVersionString = (string?)xElement.Attribute("minClientVersion"); 183var type = licenseNode.Attribute(NuspecUtility.Type)!.Value?.Trim(); 185var versionValue = licenseNode.Attribute(NuspecUtility.Version)?.Value?.Trim(); 252let includeAttribute = element.Attribute("include") 254let excludeAttribute = element.Attribute("exclude") 255let buildActionAttribute = element.Attribute("buildAction") 256let copyToOutputAttribute = element.Attribute("copyToOutput") 257let flattenAttribute = element.Attribute("flatten") 302.Select(element => ((string?)element.Attribute("file"))?.Trim()) 323let assemblyNameAttribute = element.Attribute("assemblyName") 388let idElement = element.Attribute("id") 411var srcElement = file.Attribute("src"); 435var repositoryType = element.Attribute("type"); 436var repositoryUrl = element.Attribute("url"); 437var repositoryBranch = element.Attribute("branch"); 438var repositoryCommit = element.Attribute("commit");
PackageCreation\Extensions\XElementExtensions.cs (3)
19attr = element.Attribute(localName); 23attr = element.Attribute(XName.Get(localName, namespaceName!)); 41where AttributeEquals(e, target.Attribute(e.Name))
PackagesConfigReader.cs (1)
108var node = _doc.Root!.Attribute(XName.Get(PackagesConfig.MinClientAttributeName));
PackagesConfigWriter.cs (1)
486var attribute = new XAttribute(name, newEntryNode.Attribute(name)!.Value);
Rules\InvalidUndottedFrameworkRule.cs (1)
281var attribute = element.Attribute(XName.Get(attributeName));
NuGet.Protocol (9)
LegacyFeed\LegacyFeedCapabilityResourceV2Feed.cs (5)
134let name = entitySet != null ? entitySet.Attribute("Name")?.Value : null 144var packageEntityTypeAttribute = result.EntitySet?.Attribute("EntityType"); 155select e.Attribute("Name")!.Value; 179let attribute = e.Attribute("Name") 189select e.Attribute("Name")!.Value;
LegacyFeed\V2FeedParser.cs (3)
340var downloadUrl = metadataCache.GetString(element.Element(_xnameContent)!.Attribute("src")!.Value); 631let attr = e.Attribute("rel") 633select e.Attribute("href") into nextLink
RemoteRepositories\RemoteV2FindPackageByIdResource.cs (1)
576ContentUri = element.Element(_xnameContent)!.Attribute("src")!.Value,
Roslyn.Diagnostics.Analyzers (19)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 148XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
sdk-tasks (12)
GetDependencyInfo.cs (2)
35.FirstOrDefault(d => DependencyName.Equals(d.Attribute("Name")?.Value)); 39DependencyVersion = dependency.Attribute("Version")?.Value;
OverrideAndCreateBundledNETCoreAppPackageVersion.cs (10)
56.Select(e => e.Attribute("TargetFramework")?.Value) 70.Where(e => e.Name.LocalName == elementName && e.Attribute("TargetFramework")?.Value != latestTargetFramework) 75.Where(e => e.Name.LocalName == elementName && matchAttrs.All(attr => (e.Attribute(attr)?.Value ?? "") == (item2.Attribute(attr)?.Value ?? ""))) 79Log.LogError($"No matching {elementName} in stage 0 for: {string.Join(", ", matchAttrs.Select(a => $"{a}={item2.Attribute(a)?.Value}"))}"); 84Log.LogError($"Multiple matches for {elementName} in stage 0 for: {string.Join(", ", matchAttrs.Select(a => $"{a}={item2.Attribute(a)?.Value}"))}"); 90var v0 = item0.Attribute(updateAttr)?.Value; 91var v2 = item2.Attribute(updateAttr)?.Value; 119var v0 = item0.Attribute(attr.Name)?.Value; 121Log.LogMessage(MessageImportance.Low, $"{elementName} {string.Join(", ", matchAttrs.Select(a => $"{a}={item2.Attribute(a)?.Value}"))}: Metadata '{attr.Name}' differs: stage0='{v0}', stage2='{attr.Value}'");
System.ComponentModel.TypeConverter (1)
MS\Internal\Xml\Linq\ComponentModel\XComponentModel.cs (1)
155return _value = new XDeferredSingleton<XAttribute>((e, n) => e.Attribute(n), (component as XElement)!, null);
System.Private.CoreLib.Generators (21)
NativeRuntimeEventSourceGenerator.cs (21)
48.FirstOrDefault(e => (string)e.Attribute("name") == providerName); 161string? providerName = providerNode.Attribute("name")?.Value; 178string? eventName = eventNode.Attribute("symbol")?.Value; 186string? keywords = eventNode.Attribute("keywords")?.Value; 208string? name = keywordNode.Attribute("name")?.Value; 209string? mask = keywordNode.Attribute("mask")?.Value; 224string? providerName = providerNode.Attribute("name")?.Value; 244string? name = template.Attribute("tid")?.Value; 256string? eventName = eventNode.Attribute("symbol")?.Value; 263string? eventId = eventNode.Attribute("value")?.Value; 264string? version = eventNode.Attribute("version")?.Value; 276string? eventName = eventNode.Attribute("symbol")?.Value; 288string? eventId = eventNode.Attribute("value")?.Value; 289string? version = eventNode.Attribute("version")?.Value; 296string? level = eventNode.Attribute("level")?.Value; 298.Attribute("keywords") 316string? templateValue = eventNode.Attribute("template")?.Value; 330string? paramType = data.Attribute("inType")?.Value.ToString(); 337if (!string.IsNullOrEmpty(data.Attribute("count")?.Value)) 352string? paramType = data.Attribute("inType")?.Value; 353string? paramName = data.Attribute("name")?.Value;
System.Private.Xml.Linq (6)
System\Xml\Linq\XElement.cs (3)
1217XAttribute? a = Attribute(name); 1901if (Attribute(a.Name) != null) throw new InvalidOperationException(SR.InvalidOperation_DuplicateAttribute); 1908if (Attribute(a.Name) != null) throw new InvalidOperationException(SR.InvalidOperation_DuplicateAttribute);
System\Xml\Linq\XNodeReader.cs (2)
402XAttribute? a = e.Attribute(name); 428XAttribute? a = e.Attribute(name);
System\Xml\XPath\XNodeNavigator.cs (1)
854if (ce.Attribute(name) != null)