Sidio.Sitemap.Core
3.2.0
Prefix Reserved
dotnet add package Sidio.Sitemap.Core --version 3.2.0
NuGet\Install-Package Sidio.Sitemap.Core -Version 3.2.0
<PackageReference Include="Sidio.Sitemap.Core" Version="3.2.0" />
<PackageVersion Include="Sidio.Sitemap.Core" Version="3.2.0" />
<PackageReference Include="Sidio.Sitemap.Core" />
paket add Sidio.Sitemap.Core --version 3.2.0
#r "nuget: Sidio.Sitemap.Core, 3.2.0"
#:package Sidio.Sitemap.Core@3.2.0
#addin nuget:?package=Sidio.Sitemap.Core&version=3.2.0
#tool nuget:?package=Sidio.Sitemap.Core&version=3.2.0
Sidio.Sitemap.Core
Sidio.Sitemap.Core is a lightweight .NET library for generating sitemaps. It supports sitemap index files and can be used in any .NET application. It is written in C# and is available via NuGet.
Versions
| Sidio.Sitemap.Core | Sidio.Sitemap.AspNetCore | Sidio.Sitemap.Blazor | |
|---|---|---|---|
| NuGet | |||
| Build | |||
| Coverage | |||
| Requirements | .NET Standard, .NET 8+, | .NET 8+, AspNetCore | .NET 8+, AspNetCore, Blazor server |
Installation
Add the package to your project.
Usage
Looking for ASP.NET Core integration, see Sidio.Sitemap.AspNetCore. For Blazor integration, see Sidio.Sitemap.Blazor.
Sitemap
var nodes = new List<SitemapNode> { new ("https://example.com/page.html") };
var sitemap = new Sitemap(nodes);
var service = new SitemapService(new XmlSerializer());
var xmlResult = service.Serialize(sitemap);
Sitemap index
var sitemapIndexNodes = new List<SitemapIndexNode> { new("https://example.com/sitemap-1.xml") };
var sitemapIndex = new SitemapIndex(sitemapIndexNodes);
var service = new SitemapIndexService(new XmlSerializer());
var xmlResult = service.Serialize(sitemapIndex);
Dependency injection
// DI setup
services.AddDefaultSitemapServices();
// implementation
public class MyClass()
{
public MyClass(ISitemapService service)
{
var nodes = new List<SitemapNode> { new ("https://example.com/page.html") };
var sitemap = new Sitemap(nodes);
var xmlResult = service.Serialize(sitemap);
}
}
Working with relative URLs
public class MyBaseUrlProvider : IBaseUrlProvider
{
public Uri BaseUrl => new ("https://example.com", UriKind.Absolute);
}
// DI setup
services.AddBaseUrlProvider<MyBaseUrlProvider>();
services.AddDefaultSitemapServices();
// or in one function:
services.AddDefaultSitemapServices<MyBaseUrlProvider>();
// regular setup
var serializer = new XmlSerializer(new MyBaseUrlProvider());
var service = new SitemapService(serializer);
// nodes, relative urls
var nodes = new List<SitemapNode> { new ("page.html") };
Extensions
Image sitemaps
var sitemap = new Sitemap();
sitemap.Add(new SitemapImageNode("https://example.com/page.html", new ImageLocation("https://example.com/image.png")));
Extension documentation on Google Search Central
News sitemaps
var sitemap = new Sitemap();
sitemap.Add(new SitemapNewsNode("https://example.com/page.html", "title", "name", "EN", DateTimeOffset.UtcNow));
Extension documentation on Google Search Central
Video sitemaps
var video = new VideoContent("https://example.com/thumbnail.png", "title", "description", "https://example.com/video.mp4", null);
var sitemap = new Sitemap();
sitemap.Add(new SitemapVideoNode("https://example.com/page.html", video));
Extension documentation on Google Search Central
Stylesheets
XSLT stylesheets for sitemaps and sitemap indexes are supported. The stylesheet can be added to the Sitemap or SitemapIndex object:
var sitemap = new Sitemap(nodes, "my-stylesheet.xslt");
For more information, see Sitemap Style.
Deserialization
It is possible to load existing XML and deserialize it into a sitemap object:
var xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset> ....";
var serializer = services.GetRequiredService<ISitemapSerializer>();
var sitemap = serializer.Deserialize(xml);
Benchmarks XmlSerializer sync/async (Sitemap)
BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.9445/25H2/2025Update/HudsonValley2)
AMD Ryzen 7 5800H with Radeon Graphics 3.20GHz, 1 CPU, 16 logical and 8 physical cores
.NET SDK 10.0.302
[Host] : .NET 10.0.12 (10.0.12, 10.0.1226.42308), X64 RyuJIT x86-64-v3
.NET 10.0 : .NET 10.0.12 (10.0.12, 10.0.1226.42308), X64 RyuJIT x86-64-v3
.NET 8.0 : .NET 8.0.31 (8.0.31, 8.0.3126.42015), X64 RyuJIT x86-64-v3
.NET 9.0 : .NET 9.0.18 (9.0.18, 9.0.1826.31522), X64 RyuJIT x86-64-v3
| Method | Job | Runtime | NumberOfNodes | Mean | Error | StdDev | Ratio | RatioSD |
|---|---|---|---|---|---|---|---|---|
| Serialize | .NET 10.0 | .NET 10.0 | 10 | 4.940 us | 0.0981 us | 0.0918 us | 0.84 | 0.04 |
| Serialize | .NET 8.0 | .NET 8.0 | 10 | 5.865 us | 0.1168 us | 0.2360 us | 1.00 | 0.06 |
| Serialize | .NET 9.0 | .NET 9.0 | 10 | 5.354 us | 0.0611 us | 0.0571 us | 0.91 | 0.04 |
| SerializeAsync | .NET 10.0 | .NET 10.0 | 10 | 6.328 us | 0.1233 us | 0.2192 us | 0.80 | 0.03 |
| SerializeAsync | .NET 8.0 | .NET 8.0 | 10 | 7.930 us | 0.1081 us | 0.1011 us | 1.00 | 0.02 |
| SerializeAsync | .NET 9.0 | .NET 9.0 | 10 | 6.902 us | 0.1270 us | 0.2051 us | 0.87 | 0.03 |
| Serialize | .NET 10.0 | .NET 10.0 | 100 | 37.636 us | 0.3136 us | 0.2619 us | 0.79 | 0.01 |
| Serialize | .NET 8.0 | .NET 8.0 | 100 | 47.350 us | 0.4471 us | 0.3964 us | 1.00 | 0.01 |
| Serialize | .NET 9.0 | .NET 9.0 | 100 | 41.813 us | 0.4453 us | 0.3948 us | 0.88 | 0.01 |
| SerializeAsync | .NET 10.0 | .NET 10.0 | 100 | 45.750 us | 0.2481 us | 0.2072 us | 0.82 | 0.01 |
| SerializeAsync | .NET 8.0 | .NET 8.0 | 100 | 55.988 us | 0.3038 us | 0.2693 us | 1.00 | 0.01 |
| SerializeAsync | .NET 9.0 | .NET 9.0 | 100 | 51.098 us | 0.3159 us | 0.2638 us | 0.91 | 0.01 |
| Serialize | .NET 10.0 | .NET 10.0 | 40000 | 21,965.477 us | 184.3410 us | 163.4135 us | 0.88 | 0.04 |
| Serialize | .NET 8.0 | .NET 8.0 | 40000 | 24,991.718 us | 464.2925 us | 1,278.7964 us | 1.00 | 0.07 |
| Serialize | .NET 9.0 | .NET 9.0 | 40000 | 23,005.318 us | 344.1842 us | 305.1103 us | 0.92 | 0.05 |
| SerializeAsync | .NET 10.0 | .NET 10.0 | 40000 | 22,025.450 us | 232.3676 us | 194.0375 us | 0.86 | 0.02 |
| SerializeAsync | .NET 8.0 | .NET 8.0 | 40000 | 25,542.654 us | 498.9985 us | 715.6489 us | 1.00 | 0.04 |
| SerializeAsync | .NET 9.0 | .NET 9.0 | 40000 | 24,630.967 us | 486.8769 us | 633.0775 us | 0.97 | 0.04 |
dotnet run -c Release -- --job short --runtimes net8.0 net9.0 net10.0
References
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
-
net10.0
-
net11.0
- No dependencies.
-
net8.0
-
net9.0
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Sidio.Sitemap.Core:
| Package | Downloads |
|---|---|
|
Sidio.Sitemap.AspNetCore
Sidio.Sitemap.AspNetCore is a lightweight .NET library for generating sitemaps and a sitemap index in ASP .NET Core applications. |
|
|
Sidio.Sitemap.Blazor
Sidio.Sitemap.Blazor is a lightweight .NET library for generating sitemaps in Blazor applications. |
|
|
Vorn.Cms.Client
This library contains services required to use Vorn.Cms subsystem. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 3.2.0 | 213 | 11/11/2026 | |
| 3.1.1 | 3,754 | 10/6/2026 | |
| 3.1.0 | 325 | 10/5/2026 | |
| 3.1.0-preview | 121 | 9/29/2026 | |
| 3.0.0-preview | 124 | 9/29/2026 | |
| 2.9.0 | 5,637 | 5/1/2026 | |
| 2.8.1 | 10,830 | 4/15/2026 | |
| 2.8.0 | 18,696 | 11/11/2025 | |
| 2.7.6 | 1,140 | 9/18/2025 | |
| 2.7.5 | 6,350 | 5/19/2025 | |
| 2.7.4 | 2,850 | 4/9/2025 | |
| 2.7.3 | 1,407 | 3/17/2025 | |
| 2.7.2 | 934 | 2/17/2025 | |
| 2.7.1 | 1,696 | 1/20/2025 | |
| 2.7.0 | 5,351 | 11/13/2024 | |
| 2.6.2 | 4,681 | 10/14/2024 | |
| 2.5.1 | 437 | 8/19/2024 |