JobKea 2018. 7. 12. 00:17
반응형

첫 예제인 Hellow World 를 실행하면서도 에러가 났다.


소스

unsing System;

namespace ConsoleApp
{
class Program
{
static void Main (String[] args)
{
// 문자열 출력
Console.WriteLine("Hellow World !!");
}
}
}


에러는 다음과 같다.


에러

C:\Dev\c#\sample_1>c:\Windows\microsoft.NET\Framework\v4.0.30319\csc Programs.cs


Microsoft (R) Visual C# Compiler version 4.7.3056.0

for C# 5

Copyright (C) Microsoft Corporation. All rights reserved.


This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240


Programs.cs(1,1): error CS0116: 네임스페이스는 필드나 메서드와 같은 멤버를 직접 포함할 수 없습니다.


 


매번 하는 실수인것 같은데 , 문제는 오타였다.


에러 메세지중 1번쨰줄 1번째 문자부터가 문제라고 해서 3초 정도 쨰려 봣더니 해결됬다.


문제의 에러메세지 

 => Programs.cs(1,1): error CS0116: 네임스페이스는 필드나 메서드와 같은 멤버를 직접 포함할 수 없습니다.


해결된 코드

using System;

namespace ConsoleApp
{
class Program
{
static void Main (String[] args)
{
// 문자열 출력
Console.WriteLine("Hellow World !!");
}
}
}

보면 알겠지만 unsing 이아니라 using 이다. 


ㅋㅋㅋㅋㅋㅋ..ㅋ..ㅋ..

반응형