When we use Visual Studio 2005/2008/2010, the created class is not public by default, which may be noticed by everyone. Some people may even feel a little worried like me.
I searched online with this question and found a post on stackoverflow.com (original post in English). The analysis is good. It is good to say that the default class is internal class (internal, you can hide most of the functions in the assembly, and only provide the class/interface you want to publish to the user. If you are really worried, the post also provides a method to create the default class as public, that is, ReSharper. You can also directly modify the class template of Visual Studio, the template file is located at % ProgramFiles % \ Microsoft Visual Studio 8 \ Common7 IDE \ ItemTemplates \ CSharp \ 1033 \ Class.zip.
After my test, direct modification to this zip file is invalid, or it may be because I tested it in the Visual Studio 2008 environment, and this method is only applicable to Visual Studio 2005, the Class in the compressed file % ProgramFiles % \ Microsoft Visual Studio 9.0 \ Common7 \ IDE \ ItemTemplates \ CSharp \ Code \ 1033 \ Class.zip is modified. cs file content, no effect. Finally, I found a folder named ItemTemplatesCache under % ProgramFiles % \ Microsoft Visual Studio 9.0 \ Common7 \ IDE, % ProgramFiles % \ Microsoft Visual Studio 9.0 \ Common7 \ IDE \ ItemTemplatesCache \ CSharp \ Code \ 1033 \ Class.zip \ Class. cs file content, added public in front of class, save, restart Visual Studio 2008, create a class, OK!
Finally, it is declared that this method is not an orthodox routine (I am not an orthodox programmer) and is not recommended for reference only.