Microsoft MVP성태의 닷넷 이야기
.NET Framework: 307. .NET 4.0 응용 프로그램을 위한 ILMerge [링크 복사], [링크+제목 복사],
조회: 26298
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

.NET 4.0 응용 프로그램을 위한 ILMerge


ILMerge
; http://www.microsoft.com/download/en/details.aspx?id=17630

위의 다운로드 사이트에 가보면 왠지 ILMerge가 .NET 4.0을 위한 배려는 안 되어 있는 듯이 느껴집니다. 실제로, 최근에 Hyper-V를 제어하는 프로그램을 만들면서,

Hyper-V의 가상 머신을 C#으로 제어하는 방법
; https://www.sysnet.pe.kr/2/0/1235

제가 만든 .NET 4.0 프로그램(VMController.exe)과 codeplex에서 다운로드한 System.Management.HyperV.dll을 합치는 과정에서도 다음과 같은 오류가 발생했습니다.

D:\VMController>ILMerge /out:Test.exe VMController.exe System.Management.HyperV.dll

An exception occurred during merging:
Unresolved assembly reference not allowed: System.Core.
   at System.Compiler.Ir2md.GetAssemblyRefIndex(AssemblyNode assembly)
   at System.Compiler.Ir2md.GetTypeRefIndex(TypeNode type)
   at System.Compiler.Ir2md.WriteTypeDefOrRefEncoded(BinaryWriter target, TypeNode type)
   at System.Compiler.Ir2md.WriteTypeSignature(BinaryWriter target, TypeNode type, Boolean instantiateGenericTypes)
   at System.Compiler.Ir2md.WriteTypeSignature(BinaryWriter target, TypeNode type, Boolean instantiateGenericTypes)
   at System.Compiler.Ir2md.GetBlobIndex(TypeNode type)
   at System.Compiler.Ir2md.GetTypeSpecIndex(TypeNode type)
   at System.Compiler.Ir2md.VisitReferencedType(TypeNode type)
   at System.Compiler.Ir2md.VisitClass(Class Class)
   at System.Compiler.Ir2md.VisitModule(Module module)
   at System.Compiler.Ir2md.SetupMetadataWriter(String debugSymbolsLocation)
   at System.Compiler.Ir2md.WritePE(Module module, String debugSymbolsLocation, BinaryWriter writer)
   at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols, Module module, Boolean delaySign, String keyFileName, String keyName)
   at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module)
   at ILMerging.ILMerge.Merge()
   at ILMerging.ILMerge.Main(String[] args)

혹시나 싶어서, ILMerge 설치와 함께 제공되는 도움말 파일을 보니... ^^ 다행히 .NET 4.0에 대한 지원이 추가된 것을 볼 수 있었습니다.

2.21 SetTargetPlatform
public void SetTargetPlatform(string platform, string dir);
This method sets the .NET Framework for the target assembly to be the one specified by platform. Valid strings for the first argument are "v1", "v1.1", "v2", and "v4". The "v" is case insensitive and is also optional. This way ILMerge can be used to "cross-compile", i.e., it can run in one version of the framework and generate the target assembly so it will run under a different assembly. The second argument is the directory in which mscorlib.dll is to be found. Command line option: /targetplatform:version,platformdirectory


따라서, 만약 .NET 4.0 응용 프로그램을 ILMerge로 병합하고 싶다면 다음과 같이 버전 4를 명시해 주시면 됩니다. ^^

D:\VMController>ILMerge /targetplatform:v4 /out:Test.exe VMController.exe System.Management.HyperV.dll




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 8/12/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... [166]  167  168  169  170  171  172  173  174  175  176  177  178  179  180  ...
NoWriterDateCnt.TitleFile(s)
889정성태7/5/201026561.NET Framework: 179. Dictionary.Get(A) 대신 Dictionary.Get(A.GetHashCode())를 사용해서는 안 되는 이유 [1]
888정성태6/30/201024348오류 유형: 96. Hyper-V 연결 오류 - A connection will not be made because credentials may not be sent to the remote computer
887정성태6/23/201034193개발 환경 구성: 79. Hyper-V의 가상 머신에서 소리 재생 방법 [2]
886정성태6/23/201022394제니퍼 .NET: 14. ASMX, WCF 호출 모니터링 및 누수 확인
885정성태6/20/201023938개발 환경 구성: 78. COM+ 서버에서 COM+ 서버를 호출하는 방법
884정성태6/20/201026891제니퍼 .NET: 13. COM+ 서버 모니터링 [2]
883정성태6/18/201028775개발 환경 구성: 77. Appinit_Dlls로 구현한 환경 변수 설정 DLL [5]파일 다운로드1
882정성태6/17/201031606개발 환경 구성: 76. JKS(Java Key Store)에 저장된 인증서를 ActiveX 코드 서명에 사용하는 방법 [1]
881정성태6/14/201021033제니퍼 .NET: 12. COM+ 호출 모니터링 및 누수 확인
879정성태6/10/201023703제니퍼 .NET: 11. 소켓 모니터링 기능으로 본 ASP.NET의 소켓 풀링 기능 [1]
878정성태6/6/201023491제니퍼 .NET: 10. 소켓 모니터링 기능으로 본 WCF의 WSDualHttpBinding 성능 부하
877정성태5/31/201020230제니퍼 .NET: 9. 성능 관리 퀴즈 세 번째 문제 (닷넷 개발자 컨퍼런스)
876정성태5/31/201019673제니퍼 .NET: 8. 성능 관리 퀴즈 두 번째 문제 (닷넷 개발자 컨퍼런스) [2]
875정성태5/30/201021398제니퍼 .NET: 7. 성능 관리 퀴즈 첫 번째 문제 (닷넷 개발자 컨퍼런스)
873정성태5/19/201028270제니퍼 .NET: 6. 제니퍼를 위한 방화벽 설정
872정성태5/15/201027608제니퍼 .NET: 5. 제니퍼 서버 - NT 서비스로 구동시키는 방법
871정성태5/13/201034185VC++: 40. MSBuild를 이용한 VC++ 프로젝트 빌드파일 다운로드1
870정성태5/12/201025198제니퍼 .NET: 4. 닷넷 APM 솔루션 - 제니퍼 닷넷의 기능 요약 [2]
869정성태11/8/201926664오류 유형 : 95. WCF 인증서 설정 관련 오류 정리 [4]
865정성태5/5/201028952개발 환경 구성: 75. 인증서의 개인키를 담은 물리 파일 위치 알아내는 방법파일 다운로드1
864정성태5/4/201032825.NET Framework: 178. WCF - 사용자 정의 인증 구현 예제 [4]파일 다운로드1
863정성태5/4/201058715개발 환경 구성: 74. 인증서 관련(CER, PVK, SPC, PFX) 파일 만드는 방법 [1]파일 다운로드1
862정성태5/3/201020610제니퍼 .NET: 3. 제2회 닷넷 개발자 컨퍼런스에서 뵙겠습니다. ^^
861정성태5/1/201021206.NET Framework: 177. .NET 2.0 Profiler에 .NET 4.0 지원 추가
860정성태4/30/201026291오류 유형: 95. .NET 4.0 설치 오류 - 0x800c0005 [1]
858정성태4/29/201030175제니퍼 .NET: 2. JENNIFER .NET을 이용한 .NET 웹 사이트 모니터링 (2) - 설치 [3]
... [166]  167  168  169  170  171  172  173  174  175  176  177  178  179  180  ...