All rules
CA1053Design Enabled by default: No

Static holder types should not have default constructors

Static holder types should not have default constructors

Microsoft docs

Description

A public or nested public type declares only static members and has a public or protected default constructor. The constructor is unnecessary because calling static members does not require an instance of the type. The string overload should call the uniform resource identifier (URI) overload by using the string argument for safety and security.

Cause

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

How to fix violations

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

When to suppress

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

Group results
0 yes 0 no
ConsensusNone (disabled)
Severity preference (yes voters)
Suggestion0
Warning0
Error0