FileNotFoundException on loading ILMerged assemblies
本文关键字:assemblies ILMerged loading on FileNotFoundException | 更新日期: 2023-09-27 18:32:03
我有几个程序集合并为一个。这是我的命令。
ilmerge /lib:. /keyfile:../../key.snk /targetplatform:v4 /out:..'..'build'Dynamicalabs.QbIntegration.Plugins.dll .'DynamicaLabs.QbIntegration.Plugins.dll .'Intuit.Ipp.Core.dll .'Intuit.Ipp.Data.dll .'Intuit.Ipp.DataService.dll .'Intuit.Ipp.Exception.dll .'Intuit.Ipp.Security.dll .'Intuit.Ipp.Utility.dll .'Intuit.Ipp.Diagnostics.dll .'Intuit.Ipp.Retry.dll .'Newtonsoft.Json.dll .'DevDefined.OAuth.dll .'DNL.QBIntegration.dll
问题出在 .''Intuit.Ipp.Data.dll程序集上。它的名称是.''Intuit.Ipp.Data.dll,但在文件属性Intuit.IPP.Data.dll(大写IPP)中。其他程序集正确加载,并且在描述中没有这样的东西。这会导致此错误吗?我如何编辑这个?异常消息:
System.IO.FileNotFoundException: Could not load file or assembly 'Intuit.Ipp.Data' or one of its dependencies. The system cannot find the file specified.
=== Pre-bind state information ===
LOG: DisplayName = Intuit.Ipp.Data
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Intuit.Ipp.Data | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
Newtonsoft.Json也不会加载。其他程序集 - 好的。
异常类型System.IO.FileNotFoundException
表明客户端代码中出现加载问题。有一行显式加载此 DLL,例如 Assembly.LoadFile
.在这种情况下,合并后可能会遇到问题,因为不再有单独的 Ipp.Data 程序集。
解决方案 1:不合并 Ipp.数据程序集
解决方案 2:查找导致问题的行 - 例如,在应用程序崩溃时单击调试,或附加到进程 - 然后在合并之前重新编译加载 Ipp.Data 修复程序集名称的程序集。这可以通过使用ildasm
和ilasm
实用程序来完成。教程在这里 - http://www.power-programming.co.uk/post/2009/09/23/Using-ildasm-and-ilasm-to-modify-a-NET-assembly.aspx