diff --git a/rules/S1144/csharp/rule.adoc b/rules/S1144/csharp/rule.adoc index 7d645bb021a..7a151e9bccf 100644 --- a/rules/S1144/csharp/rule.adoc +++ b/rules/S1144/csharp/rule.adoc @@ -3,6 +3,19 @@ include::../why.adoc[] +=== Exceptions + +This rule doesn't raise issues on: + +* empty constructors +* members with attributes +* the `Main` method of the application +* `void` methods with two parameters when the second parameter type derives from https://learn.microsoft.com/en-us/dotnet/api/system.eventargs[EventArgs] +* empty serialization constructor on type with https://learn.microsoft.com/en-us/dotnet/api/system.serializableattribute[System.SerializableAttribute] attribute. +* field and property members of types marked with https://learn.microsoft.com/en-us/dotnet/api/system.serializableattribute[System.SerializableAttribute] attribute +* internal members in assemblies that have a https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.internalsvisibletoattribute[System.Runtime.CompilerServices.InternalsVisibleToAttribute] attribute. +* types and members decorated with the https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.dynamicallyaccessedmembersattribute[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute] attribute (available in .NET 5.0+) or a custom attribute named `DynamicallyAccessedMembersAttribute`. + === Code examples ==== Noncompliant code example @@ -37,19 +50,6 @@ public class Foo } ---- -=== Exceptions - -This rule doesn't raise issues on: - -* empty constructors -* members with attributes -* the `Main` method of the application -* methods with event handler signature `void Foo(object, EventArgs)` that are declared in partial class -* empty serialization constructor on type with https://learn.microsoft.com/en-us/dotnet/api/system.serializableattribute[System.SerializableAttribute] attribute. -* field and property members of types marked with https://learn.microsoft.com/en-us/dotnet/api/system.serializableattribute[System.SerializableAttribute] attribute -* internal members in assemblies that have a https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.internalsvisibletoattribute[System.Runtime.CompilerServices.InternalsVisibleToAttribute] attribute. -* types and members decorated with the https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.dynamicallyaccessedmembersattribute[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute] attribute (available in .NET 5.0+) or a custom attribute named `DynamicallyAccessedMembersAttribute`. - == Resources === Documentation