vico
vico

Reputation: 18221

ILMerge - pdb associated with dll is out of date

Trying to build executable with all libraries inside with help of ILMerge:

"C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe" MyScan.exe DirectShowLib.dll Google.Apis.Auth.dll Google.Apis.Auth.PlatformServices.dll Google.Apis.Core.dll Google.Apis.dll Google.Apis.PlatformServices.dll Google.Apis.Sheets.v4.dll log4net.dll Newtonsoft.Json.dll zxing.dll zxing.presentation.dll /out:MyScan2.exe

Got error one of dll's is out of date:

An exception occurred during merging:
ILMerge.Merge:  There were errors reported in Google.Apis.Auth's metadata.
        The pdb associated with c:\Projects\Myscan\MYScan\bin\Release\Google.Apis.Auth.dll is out of date.
   at ILMerging.ILMerge.Merge()
   at ILMerging.ILMerge.Main(String[] args)

What does it mean? Why Google.Apis.Auth.dll pdb is out of date and how to fix that? I have cleaned and rebuilt project, but this not helped.

UPD

I had to delete all pdb's associated with google api. After that I got error:

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.VisitMethod(Method method)
   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)

Upvotes: 5

Views: 2319

Answers (2)

ondrisko
ondrisko

Reputation: 320

You are probably facing problems with portable PDBs. See https://github.com/dotnet/ILMerge/issues/11 for more details. There are four options for you:

  1. Delete the problematic PDBs before merging
  2. Use the most recent version of ILMerge, that gracefully declines them
  3. Use /ndebug switch for the ilmerge command to skip all PDBs
  4. select the 'Full' option for 'Debugging information' in project properties

Options 1-3 lose the debug info for the assembly/ies. Option 4 can only be used if portable .PDBs are not required.

Upvotes: 0

GP89
GP89

Reputation: 6740

I'm not totally sure, but I was running into the same error

I found I was getting the error if I renamed the ddl before using ilmerge, even if I renamed the pdb as well.

Leaving the original filename fixed it for me

Upvotes: 0

Related Questions