A type that's not accessible outside its assembly and has no subtypes within its containing assembly is not marked sealed (NotInheritable in Visual Basic).
Rule description
When a type isn't accessible outside its assembly and has no subtypes within its containing assembly, it can be safely sealed. Sealing types can improve performance. For more information, see Analyzer Proposal: Seal internal/private types].
You can configure this option for just this rule, for all rules it applies to, or for all rules in this category (Performance) that it applies to. For more information, see Code quality rule configuration options.
Ignore InternalsVisibleTo attribute
By default, this rule is disabled if the assembly being analyzed uses InternalsVisibleToAttribute to expose its internal symbols. You can set the ignore_internalsvisibleto option to change the configuration. To specify that the rule should run even if the assembly is marked with InternalsVisibleToAttribute, add the following key-value pair to an .editorconfig file in your project:
Replace the XXXX part of CAXXXX with the ID of the applicable rule.
This option is available starting in .NET 8.
Surađujte s nama na GitHubu
Izvor za ovaj sadržaj možete pronaći na GitHubu, gdje možete stvarati i pregledavati probleme i zahtjeve za povlačenjem. Dodatne informacije potražite u našem vodiču za suradnike.
Povratne informacije o proizvodu .NET
.NET je projekt otvorenog koda. Odaberite vezu za slanje povratnih informacija:
Pridružite se seriji susreta kako biste s kolegama programerima i stručnjacima izgradili skalabilna rješenja umjetne inteligencije temeljena na stvarnim slučajevima upotrebe.