Modify Class Templates

When you create a new class in Visual Studio, it gets created as internal class <classname>. Most of the time you'll want it created as a public class. While it's a minor change, if you're sick of having to change it every time you can change the template it uses.

The template for .cs classes are located in C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class\class.cs and look like:

using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;
$if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks;
$endif$
namespace $rootnamespace$
{
    class $safeitemrootname$
    {
    }
}

To have it create a public class each time you just need to change class $safeitemrootname$ to public class $safeitemrootname$ like so:

using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;
$if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks;
$endif$
namespace $rootnamespace$
{
    public class $safeitemrootname$
    {
    }
}

Save the changes (admin privileges required) and the next time you create a class it'll be a public class.

This is for Visual Studio 2022 Professional, different versions and editions should have the same file but it will be a different path.