Rylah's Study & Daily Life
[C#/VS2022].Net Core 6.0부터 변경된 Console 본문
최근 VS 2022로 C# Console을 생성하면 이렇게 보인다.
1
2
|
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
|
cs |
기존의 using, namespace, class, Main을 숨겨놨다.
Top Level Statement를 바로 접근한다는 의미이다.
기존 처럼 사용하려면
https://docs.microsoft.com/nl-nl/dotnet/core/tutorials/top-level-templates
http://www.csharpstudy.com/Latest/CS10-VS2022.aspx
를 참고로 할 수 있는데 .. 기존의 책들은 예전 C# 버전을 기반으로 서술되어 코드가 달라서 당황할 수 있다.
이 코드를 복붙하면 된다. 처음 링크에 가면 그대로 있다.
1
2
3
4
5
6
7
8
9
10
11
12
|
using System;
namespace MyApp // Note: actual namespace depends on the project name.
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
|
cs |
'Study > C#' 카테고리의 다른 글
c# (0) | 2022.03.28 |
---|---|
[C#/Study] 05. Enum (0) | 2022.02.27 |
[C#/Study] 04. Operator (0) | 2022.02.27 |
[C#/Study] 03. Method (0) | 2022.02.27 |
[C#/Study] 02. DataType / Overflow (0) | 2022.02.26 |