부모글 보이기/감추기 AD BLOCK 해제 요청 이 글에는 광고가 많이 들어가 있지 않습니다. adblock을 해제하셔도 글을 읽는데 그다지 부담이 없으니 해제를 부탁드립니다. (연관된 글이 1개 있습니다.) (2021-06-27 업데이트) .NET Core 2.2.2 SDK부터 함께 배포되는 Roslyn 컴파일러에는 이제 더 이상 csc.exe가 제공되지 않으며 csc.dll로만 존재해 직접적으로 수행할 수 없게 되었습니다. .NET Core 환경에서 (프로젝트가 아닌) C# 코드 파일을 입력으로 컴파일하는 방법 (4.x 기준의) .NET Framework이 설치된 경우에는 다음의 경로에, 32비트: C:\Windows\Microsoft.NET\Framework\v4.0.30319 64비트: C:\Windows\Microsoft.NET\Framework64\v4.0.30319 고정적으로 csc.exe가 있어 다음과 같이 쉽게(?) 빌드할 수 있었습니다. c:\temp> "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc" program.cs 그런데, 닷넷 코어 환경에서는 경로가 잘 알려진 "dotnet.exe"가 기본적으로 프로젝트 기반으로 빌드를 담당하면서 내부적으로는 csc.exe가 감춰져 있는 형태입니다. 따라서 개별 파일로 빌드하려면 직접 csc.exe를 찾아내야 하는데요. 이럴 때 where.exe를 이용해 다음과 같이 csc.exe가 있는 폴더로 이동할 수 있습니다. C:\temp> where dotnet C:\Program Files\dotnet\dotnet.exe C:\Program Files (x86)\dotnet\dotnet.exe C:\temp> cd "C:\Program Files\dotnet\sdk\3.0.100\Roslyn\bincore" C:\Program Files\dotnet\sdk\3.0.100\Roslyn\bincore> csc Microsoft (R) Visual C# Compiler version 3.3.1-beta3-19461-02 (2fd12c21) Copyright (C) Microsoft Corporation. All rights reserved. warning CS2008: No source files specified. error CS1562: Outputs without source must have the /out option specified 역시나, 저렇게 Roslyn 폴더를 찾아가기보다는... "dotnet build"가 더 선호될 수밖에 없겠습니다. ^^ [이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.] [다음 글] 개발 환경 구성: 461. C# 8.0의 #nulable 관련 특성을 .NET Framework 프로젝트에서 사용하는 방법[이전 글] 개발 환경 구성: 459. .NET Framework 프로젝트에서 C# 8.0/9.0 컴파일러를 사용하는 방법 [연관 글] .NET Framework: 2034. .NET Core/5+ 환경에서 (프로젝트가 아닌) C# 코드 파일을 입력으로 컴파일하는 방법 - 두 번째 이야기 [최초 등록일: 10/12/2019] [최종 수정일: 7/7/2023] 이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다. by SeongTae Jeong, mailto:techsharer at outlook.com 비밀번호 댓글 작성자 2019-10-12 11시19분 Is it possible to compile a single C# code file with the .NET Core Roslyn compiler?; https://stackoverflow.com/questions/46065777/is-it-possible-to-compile-a-single-c-sharp-code-file-with-the-net-core-roslyn-c 정성태 ... 106 107 108 109 110 111 112 113 114 [115] 116 117 118 119 120 ... NoWriterDateCnt.TitleFile(s) 11092정성태11/3/201633950.NET Framework: 618. C# - NAudio를 이용한 MP3 파일 재생 [5]111091정성태11/3/201627459VC++: 104. std::call_once를 이용해 thread-safe한 Singleton 객체 생성111090정성태11/1/201628937VC++: 103. C++ CreateTimerQueue, CreateTimerQueueTimer 예제 코드 [9]111089정성태11/1/201628938디버깅 기술: 82. Windows 10을 위한 Symbol(PDB) 파일 내려받는 방법 [2]11088정성태11/1/201631938.NET Framework: 617. C# - AForge.NET을 이용한 MP4 동영상 파일 재생 [7]111087정성태11/1/201626221.NET Framework: 616. AForge.Video.FFMPEG를 최신 버전의 ffmpeg 파일로 의존성을 변경하는 방법111086정성태11/1/201620667오류 유형: 366. The Microsoft Passport Container service terminated with the following error: General access denied error11085정성태10/27/201635709.NET Framework: 615. C# - AForge.NET을 이용한 웹캠 영상 출력 [2]111084정성태10/26/201623289오류 유형: 365. The User Profile Service service failed to the sign-in.11083정성태10/26/201629752Windows: 131. 윈도우 10에서 사라진 "Adapters and Bindings" 네트워크 우선 순위 조정 기능 [1]11082정성태10/26/201632262.NET Framework: 614. C# - DateTime.Ticks의 정밀도 [4]111081정성태10/26/201622161오류 유형: 364. You need to fix your Microsoft Account for apps on your other devices to be able to launch apps and continue experiences on this device.11080정성태10/24/201625841Windows: 130. Windows Server 2016 Nano 서버 설치 방법11079정성태10/21/201622947Windows: 129. Windows Server 2016 설치 CD에 있는 Convert-WindowsImage.ps1 사용 방법 정리11078정성태10/21/201624148Windows: 128. Windows Server 2016 Nano 서버 VHD 이미지 만드는 방법 - TP5 기준11077정성태10/21/201622282오류 유형: 363. Active Directory 서버의 NETLOGON 서비스가 멈췄을 때 발생하는 문제11076정성태10/21/201622051오류 유형: 362. 윈도우 백업 시 오류 - 0x8078004011075정성태10/20/201622142Windows: 127. Convert-WindowsImage.ps1 사용 방법 정리11074정성태10/20/201631414Windows: 126. Windows Server 2016 평가판을 정식 버전으로 라이선스 변경하는 방법11073정성태10/20/201627706.NET Framework: 613. 윈도우 데스크톱 응용 프로그램(예: Console)에서 알림 메시지(Toast notifications) 띄우기 [1]111072정성태10/20/201624589VC++: 102. 새로 추가한 ATL COM 객체가 regsvr32.exe로 등록이 안 되는 문제11071정성태10/20/201627578.NET Framework: 612. UWP(유니버설 윈도우 플랫폼) 앱에서 콜백 함수 내에서의 UI 요소 접근 방법 [1]11070정성태10/20/201620860Windows: 125. 윈도우 서버 2016 마이그레이션11069정성태10/19/201629086.NET Framework: 611. C++ 개발자들을 위한 C# Thread 동작 방식 [2]11068정성태10/19/201632212Windows: 124. 윈도우 운영체제의 시간 함수 (5) - TSC(Time Stamp Counter)와 QueryPerformanceCounter [12]111067정성태10/18/201627946Windows: 123. 윈도우 운영체제의 시간 함수 (4) - RTC, TSC, PM Clock, HPET Timer [2] ... 106 107 108 109 110 111 112 113 114 [115] 116 117 118 119 120 ...