.NET Framework에서 Windows Forms으로 개발하다 보면 빠르게 결과를 출력해보고 싶어 간혹 출력 형식을 콘솔 애플리케이션
으로 바꾼 후 확인하곤 합니다.
그런데 .NET 5에서 동일하게 출력 형식을 콘솔 애플리케이션
으로 바꾼 후 실행해보았는데 콘솔이 안뜨는 군요. 이럴때 프로젝트 설정에 <DisableWinExeOutputInference>true</DisableWinExeOutputInference>
를 추가하면 됩니다.
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<DisableWinExeOutputInference>true</DisableWinExeOutputInference>
</PropertyGroup>