在 Visual Studio 2019 中,当我在 C# 中创建一个新的 .NET Framework 控制台应用程序时,它会将入口点放置在一个名为的类中,该类名为一个与我的项目同名的命名空间和Program
一个文件:Program.cs
namespace ProjectName
{
class Program
{
static void Main(string[] args)
{
}
}
}
我总是最终删除命名空间并将类和文件重命名为EntryPoint
( .cs
),将入口点类放在全局命名空间中。
sealed class EntryPoint
{
static void Main(string[] args)
{
}
}
从现在开始,我有什么办法可以使它成为这种类型的所有新项目的默认行为,而无需每次都手动执行?换句话说,我可以更改此类项目中默认文件的外观吗?