성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] 그냥 RSS Reader 기능과 약간의 UI 편의성 때문에 사용...
[이종효] 오래된 소프트웨어는 보안 위협이 되기도 합니다. 혹시 어떤 기능...
[정성태] @Keystroke IEEE의 문서를 소개해 주시다니... +_...
[손민수 (Keystroke)] 괜히 듀얼채널 구성할 때 한번에 같은 제품 사라고 하는 것이 아...
[정성태] 전각(Full-width)/반각(Half-width) 기능을 토...
[정성태] Vector에 대한 내용은 없습니다. Vector가 닷넷 BCL...
[orion] 글 읽고 찾아보니 디자인 타임에는 InitializeCompon...
[orion] 연휴 전에 재현 프로젝트 올리자 생각해 놓고 여의치 않아서 못 ...
[정성태] 아래의 글에 정리했으니 참고하세요. C# - Typed D...
[정성태] 간단한 재현 프로젝트라도 있을까요? 저런 식으로 설명만 해...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <h1 style='font-family: Malgun Gothic, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>.NET Core/5+ - Process terminated. Couldn't find a valid ICU package installed on the system</h1> <p> 간단한 콘솔 응용 프로그램을 만들고,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > // .NET 7 + linux-x64 internal class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); } } </pre> <br /> linux-x64 유형으로,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net7.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <span style='color: blue; font-weight: bold'><RuntimeIdentifier>linux-x64</RuntimeIdentifier></span> </PropertyGroup> </Project> </pre> <br /> publish를 해줍니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > dotnet publish </pre> <br /> 출력된 파일들을 일부 컨테이너 환경에서 만든 이미지로 실행하는 경우,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > FROM <span style='color: blue; font-weight: bold'>debian:buster-slim</span> WORKDIR /app COPY . . </pre> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > c:\temp> <span style='color: blue; font-weight: bold'>docker build -t debian_buster -f Dockerfile .</span> c:\temp> <span style='color: blue; font-weight: bold'>docker run -it debian_buster /bin/bash</span> # <span style='color: blue; font-weight: bold'>./bin/Release/net7.0/linux-x64/publish/ConsoleApp1</span> </pre> <br /> 이런 예외가 발생합니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Process terminated. Couldn't find a valid <a target='tab' href='https://www.sysnet.pe.kr/2/0/13430'>ICU package</a> installed on the system. Please install libicu (or icu-libs) using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. Please see https://aka.ms/dotnet-missing-libicu for more information. at System.Environment.FailFast(System.String) at System.Globalization.GlobalizationMode+Settings..cctor() at System.Globalization.Ordinal.IndexOfOrdinalIgnoreCase(System.ReadOnlySpan`1<Char>, System.ReadOnlySpan`1<Char>) at System.Globalization.Ordinal.IndexOf(System.String, System.String, Int32, Int32, Boolean) at System.String.Contains(System.String, System.StringComparison) at System.TerminalFormatStrings..ctor(Database) at System.ConsolePal+<>c.<.cctor>b__114_0() at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ViaFactory(System.Threading.LazyThreadSafetyMode) at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExecutionAndPublication(System.LazyHelper, Boolean) at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValue() at System.ConsolePal.EnsureInitializedCore() at System.ConsolePal.Write(Microsoft.Win32.SafeHandles.SafeFileHandle, System.ReadOnlySpan`1<Byte>, Boolean) at System.IO.StreamWriter.Flush(Boolean, Boolean) at System.IO.StreamWriter.WriteLine(System.String) at System.IO.TextWriter+SyncTextWriter.WriteLine(System.String) at System.Console.WriteLine(System.String) at Program.<Main>$(System.String[]) Aborted </pre> <br /> 오류 메시지에도 나오지만,<br /> <br /> <div style='BACKGROUND-COLOR: #ccffcc; padding: 10px 10px 5px 10px; MARGIN: 0px 10px 10px 10px; FONT-FAMILY: Malgun Gothic, Consolas, Verdana; COLOR: #005555'> Process terminated. Couldn't find a valid ICU package installed on the system. Please install libicu (or icu-libs) using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. Please see <a target='tab' href='https://aka.ms/dotnet-missing-libicu'>https://aka.ms/dotnet-missing-libicu</a> for more information.<br /> </div><br /> <br /> 해결 방법은 다양하게 있습니다. 간단하게는 libicu 구성 요소를 설치하면 되는데요, <br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > # apt-get update && apt-get install -y apt-transport-https # apt-get install -y libicu-dev </pre> <br /> 그렇긴 해도 응용 프로그램 실행을 위해 시스템을 변경해야 하는 것이 살짝 어려울 수 있습니다. 또 다른 방법은, 메시지에 나오듯이,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Runtime configuration options for globalization ; <a target='tab' href='https://aka.ms/dotnet-missing-libicu '>https://aka.ms/dotnet-missing-libicu </a> ; <a target='tab' href='https://learn.microsoft.com/en-us/dotnet/core/runtime-config/globalization'>https://learn.microsoft.com/en-us/dotnet/core/runtime-config/globalization</a> </pre> <br /> System.Globalization.Invariant 설정을 하는 것입니다. 따라서 아래와 같이 ConsoleApp1.template.json 파일(<a target='tab' href='https://www.sysnet.pe.kr/2/0/12983'>runtimeconfig.template.json</a>)을 편집해 설정하면 됩니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > { "runtimeOptions": { "tfm": "net7.0", "includedFrameworks": [ { "name": "Microsoft.NETCore.App", "version": "7.0.3" } ], "configProperties": { <span style='color: blue; font-weight: bold'>"System.Globalization.Invariant": true</span> } } } </pre> <br /> 혹은 환경 변수를 이용하는 방법도 있습니다. (만약 <a target='tab' href='https://www.sysnet.pe.kr/2/0/13265'>PublishSingleFile 옵션으로 빌드했다면 반드시 환경 변수를 통해서만 런타임 변경이 가능</a>합니다.)<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > # <span style='color: blue; font-weight: bold'>export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1</span> </pre> <br /> 또는, 아예 빌드 과정에서 지정하는 것도 가능합니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net7.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <span style='color: blue; font-weight: bold'><InvariantGlobalization>true</InvariantGlobalization></span> </PropertyGroup> </Project> </pre> </p><br /> <br /><hr /><span style='color: Maroon'>[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
2028
(왼쪽의 숫자를 입력해야 합니다.)