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 开发者_Go百科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?
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?
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
Would it help to try .NETZ instead of ILMerge?
精彩评论