A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1053 below:

CA1053: Static holder types should not have constructors (code analysis) - .NET

CA1053: Static holder types should not have default constructors

In this article Property Value Rule ID CA1053 Title Static holder types should not have default constructors Category Design Fix is breaking or non-breaking Breaking Enabled by default in .NET 9 No Cause

A public or nested public type declares only static members and has a default constructor.

Rule description

The default constructor is unnecessary because calling static members does not require an instance of the type. Also, because the type does not have non-static members, creating an instance does not provide access to any of the type's members.

How to fix violations

To fix a violation of this rule, remove the default constructor.

When to suppress warnings

Do not suppress a warning from this rule. The presence of the default constructor suggests that the type is not a static type.

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.

Additional resources

In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4