MSBuild.exe 파일의 경로를 찾아줍니다.
ex) 전 2019 Community 버전을 사용하고 있습니다.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
text 파일로 아래와 같이 작성을 해준 후 .bat 파일로 저장하면 완성입니다!
:msbuild 파일이 있는 곳으로 이동 (참고로 배치에서 : 은 주석!)
cd C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
:빌드할 솔루션 지정
msbuild C:\Users\dlaeh\source\repos\WindowsFormsApp1\WindowsFormsApp1.sln
: 결과를 보고 싶으면 pause 명령을 통해 멈춰줍니다.
pause
해당 배치파일 실행한 결과!!

좀 더 옵션을 줄 수도 있습니다.
:msbuild 파일이 있는 곳으로 이동
cd C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
:빌드할 솔루션 지정
msbuild C:\Users\dlaeh\source\repos\WindowsFormsApp1\WindowsFormsApp1.sln /t:Rebuild /p:Configuration="Release" /p:Platform="Any CPU"
:/t:Rebuild 재빌드
:/p:Configuration="Release" 디버그 혹은 릴리즈 혹은 사용자 지정 세팅
:/p:Platform="Any CPU" 타겟 플랫폼 지정
:/v:quiet 조용히 빌드하기
: 결과를 보고 싶으면 pause 명령을 통해 멈춰줍니다.
pause
Configuration과 Platform 은 구성 관리자에서 추가도 가능합니다.

'기타 > 유용한 것' 카테고리의 다른 글
[cmd] 명령어 정리하기 (0) | 2024.04.20 |
---|---|
SFTP 구축 및 연결 (freeFTPd, WinSCP/FileZilla) (0) | 2023.04.09 |
NSIS 설치 파일 만들기 (0) | 2022.08.18 |