This is an old revision of the document!
Table of Contents
Publishing, Deploying, and Running a .NET Application Using Visual Studio
개발 환경에서 작성한 .NET 애플리케이션을 ComfilePi와 같은 ARM Linux 장치에서 실행하려면 다음 단계를 순서대로 수행해야 합니다.
- 대상 장치의 CPU 아키텍처와 운영체제에 맞게 애플리케이션을 Publish
- 생성된 바이너리 파일을 대상 장치로 전송(Deploy)
- 대상 장치에서 실행
애플리케이션 Publish
- Visual Studio에서 .NET 프로젝트를 Publish하려면
Solution Explorer에서 프로젝트를 우클릭한 후 Publish 를 선택합니다.
- Advanced Settings 에서 linux-arm64 런타임을 선택합니다.
대상 장치에 .NET SDK 또는 Runtime이 이미 설치되어 있다면
//Framework Dependent// 모드를 선택합니다.
{{ :comfilepi:dotnet:deploy:visual_studio:vs_publish_2.png }} \\
- Publish 버튼을 눌러 빌드를 시작합니다.
성공하면 Target location 폴더에서 생성된 바이너리 파일을 확인할 수 있습니다.
{{ :comfilepi:dotnet:deploy:visual_studio:vs_publish_3.png }}
애플리케이션 배포 (Deploy)
- FileZilla 같은 GUI 프로그램을 사용하거나
아래 scp 명령으로
파일을 ComfilePi로 복사합니다.
scp -r * {comfilepi_user}@{comfilepi_ip_address}:{comfilepi_folder}
- 필요 시 아래 chmod 명령으로
실행 파일에 실행 권한을 부여합니다.
ssh {comfilepi_user}@{comfilepi_ip_address} chmod +x {comfilepi_folder}/{executable_file}
애플리케이션 실행
바이너리 파일이 정상적으로 전송되고 실행 권한이 설정되었다면 터미널에서 실행 파일을 호출하여 실행할 수 있습니다.
./{executable_file}
SSH 세션에서 실행하며 X11 디스플레이가 필요한 경우,
먼저 DISPLAY 환경 변수를 설정한 뒤 실행합니다.
export DISPLAY=":0.0"
./{exectuable_file}
