Skip to content

Fix CS8981: Rename lowercase type names to PascalCase#745

Merged
poppastring merged 2 commits into
mainfrom
copilot/fix-type-names-issue
Nov 9, 2025
Merged

Fix CS8981: Rename lowercase type names to PascalCase#745
poppastring merged 2 commits into
mainfrom
copilot/fix-type-names-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 8, 2025

The C# compiler emits CS8981 warnings for type names using only lowercase ASCII characters (changefreq, url, urlset), as these may become reserved keywords in future language versions.

Changes

  • Renamed types to PascalCase:

    • changefreqChangeFreq
    • urlUrl
    • urlsetUrlSet
    • urlCollectionUrlCollection
  • Preserved XML serialization compatibility by explicitly specifying lowercase names in attributes:

    [XmlTypeAttribute("changefreq", Namespace = "...")]
    [XmlRootAttribute("changefreq", Namespace = "...")]
    public enum ChangeFreq
  • Updated all references in SiteManager.cs, ISiteManager.cs, and test files

This maintains backward compatibility with existing XML sitemap files while eliminating all 6 CS8981 warnings.

Original prompt

This section details on the original issue you should resolve

<issue_title>Fix CS8981: Type names use only lower-cased ascii characters (may become reserved)</issue_title>
<issue_description>The following type names use only lower-cased ascii characters, which may become reserved for the language:

  • changefreq (changefreq.cs, GoogleSiteMap.cs)
  • urlset (GoogleSiteMap.cs, urlset.cs)
  • url (GoogleSiteMap.cs, url.cs)

Consider renaming these types to avoid future compatibility issues.

Files:

  • DasBlog.Services\Seo\GoogleSiteMap\changefreq.cs
  • DasBlog.Services\Seo\GoogleSiteMap\GoogleSiteMap.cs
  • DasBlog.Services\Seo\GoogleSiteMap\url.cs
  • DasBlog.Services\Seo\GoogleSiteMap\urlset.cs</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: poppastring <8739371+poppastring@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CS8981 type names to avoid future compatibility issues Fix CS8981: Rename lowercase type names to PascalCase Nov 8, 2025
Copilot AI requested a review from poppastring November 8, 2025 21:50
@poppastring poppastring marked this pull request as ready for review November 9, 2025 00:49
@poppastring poppastring merged commit 03da71b into main Nov 9, 2025
3 checks passed
@poppastring poppastring deleted the copilot/fix-type-names-issue branch November 9, 2025 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix CS8981: Type names use only lower-cased ascii characters (may become reserved)

2 participants