สร้างโปรเจ็กส์ด้วย Template แบบ Console Application
dotnet new console -f net5.0 -o Console5
จะได้ไฟล์
- Console5\Console5.csproj
- Console5\Program.cs
ไฟล์ Console5.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
ไฟล์ Program.cs
using System;
namespace Console5
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}