The library 'libhostpolicy.so' required to execute the application was not found in '...'
리눅스에서 .NET Core 프로그램을 실행하는 경우 다음과 같이 오류가 발생한다면?
$ dotnet ./test.dll
A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/home/tusr/'.
Failed to run as a self-contained app. If this should be a framework-dependent app, add the /home/tusr/test.runtimeconfig.json file specifying the appropriate framework.
위의 메시지에도 나오지만, test.dll과 같은 디렉터리에 "test.runtimeconfig.json" 파일도 함께 배포해줘야만 합니다.
이에 관해서는 예전 글에서 한 번 설명한 적이 있습니다. ^^
dotnet.exe - run, exec, build, restore, publish 차이점
; https://www.sysnet.pe.kr/2/0/11300
참고로, 해당 파일은 단순한 텍스트이기 때문에 여차하면 그냥 만들어 사용해도 됩니다.
{
"runtimeOptions": {
"tfm": "netcoreapp2.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "2.0.0"
}
}
}
[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]