Skip to content

Implement XML Linting for .csproj and Related Files #43583

Open
@JonDouglas

Description

@JonDouglas

Is your feature request related to a problem? Please describe.

Over the years, I have observed recurring challenges associated with various XML-based project files in the .NET ecosystem, including .csproj, .props, and others. Currently, there is no integrated linter to validate these XML files, which leads to several issues:

Invisible Syntax Errors: Minor mistakes such as missing closing tags (/>) or incorrect nesting can go unnoticed during manual editing. These errors are often not apparent until a build fails, causing frustration and wasting developer time.

Inconsistent Formatting: Without linting, XML files may suffer from inconsistent formatting, making them harder to read and maintain, especially in collaborative environments.

Silent Failures: Some XML errors may not produce clear or immediate feedback, resulting in builds that fail for obscure reasons, complicating the debugging process.

An example of these challenges is documented in NuGet/Home#13469, where the absence of proper linting led to unforeseen issues that could have been prevented with better XML validation.

Describe the solution you'd like

I propose the integration of an XML linting feature within the .NET SDK that specifically targets project-related XML files such as .csproj, .props, and others.

It should validate syntax, enforce basic formatting, report errors, and maybe real time linting in tooling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions