C#
[c#][.NET Core] 콘솔 애플리케이션으로 실행
JeonH
2023. 1. 17. 14:39
.NET Core로 진행할 때 프로젝트 출력 형식을 콘솔 애플리케이션(Console Application)으로 설정해도
Console 창이 나타나지 않아 불편함이 있었습니다.
이를 해결하기 위해서 프로젝트 파일(.csproj)을 메모장으로 열어 PropertyGroup 안에 다음을 넣어줍니다
<DisableWinExeOutputInference>true</DisableWinExeOutputInference>
그러면 아래처럼 작성됩니다.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<UseWPF>true</UseWPF>
<DisableWinExeOutputInference>true</DisableWinExeOutputInference>
</PropertyGroup>
.
.
.
</Project>
그리고 앱을 실행하면 콘솔창이 나타나는 것을 볼 수 있습니다.
출처
.NET 5 / Windows Forms에서 Console창이 뜨지 않는 경우 - 👨🏫 튜토리얼, 팁, 강좌 - 닷넷데브 (dotnetdev.kr)
반응형