Skip to content

Fix IDE0049: PreferBuiltInOrFrameworkType #25922

Open

Description

@xtqqczze

Use language keywords instead of framework type names for type references

https://learn.microsoft.com/en-gb/dotnet/fundamentals/code-analysis/style-rules/ide0049

Activity

  1. added
    Needs-Triage
    on Aug 26, 2025
  2. changed the title [-]Enable `IDE0049: PreferBuiltInOrFrameworkType`[/-] [+]Fix `IDE0049: PreferBuiltInOrFrameworkType`[/+] on Aug 26, 2025
  3. xtqqczze commented on Aug 26, 2025

    @xtqqczze
    ContributorAuthor

    Enabling IDE0049 only has an effect at design time, not build build time because the rule has internal setting EnforceOnBuild.Never:

    https://github.com/dotnet/roslyn/blob/b467cfbff565a16d1791a684e28be2ef6b86bf01/src/Analyzers/Core/Analyzers/EnforceOnBuildValues.cs#L140C76-L140C96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-Triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions