merging .dll files with ILMerge failing to work

微笑、不失礼 提交于 2019-12-10 17:52:40

问题


First of all, I'm not sure if this is a problem with ILMerge or not, but I can't merge.dll files into my application. I tried this on the command line:

ilmerge /target:winexe /out:test.exe MyApp.exe lib1.dll lib2.dll lib3.dll

I got the following error, and I have no idea what it means:

There were errors reported in MyApp's metadata. The pdb associated with D:\C#\source\bin\ReleaseMyApp.exe is out of date.

I'm using the latest version by the way (2.10.526.0), but yeah I can't get this to work and I really need some help. What does the above error mean and how can I fix it?


回答1:


The pdb associated with D:\C#\source\bin\ReleaseMyApp.exe is out of date.

Since you haven't explicitly said that you have checked the pdb and exes are in sync, I guess I'll ask the obvious question - Is there a pdb in the folder and have you checked the timestamps on the files?

As I understand it, if there is debug info available for the source files, then ilmerge will create debug information for the target and if the original is out-of-date, then it probably displays this error rather than generate incorrect information.

If you don't need the debug information, what happens if you delete the pdb files?




回答2:


I expect this type metadata is being stored as a string, perhaps in explicit code, but perhaps via a "typeof" in an attribute.

You might try handling the AppDomain's TypeResolve event, detecting the type string that is failing and returning the Type you intend - this should work around the fact that it is now in a different assembly.

http://msdn.microsoft.com/en-us/library/system.appdomain.typeresolve.aspx




回答3:


Would it help to try .NETZ instead of ILMerge?



来源:https://stackoverflow.com/questions/4635573/merging-dll-files-with-ilmerge-failing-to-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!