简体   繁体   English

加载ILMerged程序集时出现FileNotFoundException

[英]FileNotFoundException on loading ILMerged assemblies

I have several assemblies that merged into one. 我有几个程序集合并为一个。 Here my command. 这是我的命令。

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

The problem is with .\\Intuit.Ipp.Data.dll assembly. 问题在于。\\ Intuit.Ipp.Data.dll程序集。 It name is .\\Intuit.Ipp.Data.dll, but in file properties Intuit.IPP.Data.dll(capital IPP) . 名称是。\\ Intuit.Ipp.Data.dll,但在文件属性Intuit.IPP.Data.dll(大写IPP)中。 Other assemblies loaded correctly and don't have such thing in description. 其他程序集已正确加载,并且说明中没有此类内容。 May this cause this error? 这可能导致此错误吗? And how I edit this? 以及我如何编辑它? Exception message: 异常消息:

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 does not load too. Newtonsoft.Json也不会加载。 Other assemblies - ok. 其他组装-好的。

Type of exception System.IO.FileNotFoundException suggest that problem with loading occurs in client code. 异常类型System.IO.FileNotFoundException建议客户端代码中发生加载问题。 There is a line that explicitly loads this DLL using eg Assembly.LoadFile . 有一行使用例如Assembly.LoadFile显式加载此DLL。 In that case you may have trouble after merging, because there is no longer separate Ipp.Data assembly. 在这种情况下,合并后可能会遇到麻烦,因为不再有单独的Ipp.Data程序集。

Solution 1: Don't merge Ipp.Data assembly 解决方案1:不要合并Ipp.Data程序集

Solution 2: Find line that causes troubles - eg click Debug on app crash, or attach to process - then before merge recompile assembly that loads Ipp.Data fixing assembly name. 解决方案2:找到引起问题的行-例如,在应用程序崩溃时单击“调试”,或附加到进程-然后在合并加载Ipp.Data固定程序集名称的重新编译程序集之前。 This can be done by using ildasm and ilasm utilities. 可以使用ildasmilasm实用程序来完成。 Tutorial here - http://www.power-programming.co.uk/post/2009/09/23/Using-ildasm-and-ilasm-to-modify-a-NET-assembly.aspx 此处的教程-http: //www.power-programming.co.uk/post/2009/09/23/Using-ildasm-and-ilasm-to-modify-a-NET-assembly.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM