Search code examples
c#.netvisual-studiocodemaid

How to change default access modifer added by CodeMaid


I am using the Visual Studio CodeMaid plugin currently and when I press Ctrl+m+space to cleanup my active document it adds a default access modifier of internal to my class/interface/etc.. I've looked through the options to change it to be public, but haven't had any luck. Is it possible to change this?


Solution

  • For most member types:

    internal is the default if no access modifier is specified. Access Modifiers (C# Programming Guide)

    CodeMaid has the option to explicitly specify the access modifier in order to reduce the chance for developer confusion. You can disable this behavior at CodeMaid->Options->Cleaning->Insert->"Insert explicit access modifiers for" and toggle individual member types (e.g. classes, properties, etc.)

    If you want to change something from its default internal to public, you will need to explicitly add the public access modifier.

    Hope it helps.