Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ILMerge-与dll关联的pdb已过期_C#_Google Api_Pdb Files_Ilmerge - Fatal编程技术网

C# ILMerge-与dll关联的pdb已过期

C# ILMerge-与dll关联的pdb已过期,c#,google-api,pdb-files,ilmerge,C#,Google Api,Pdb Files,Ilmerge,在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.

在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
出现错误,其中一个dll已过期:

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)
这是什么意思?为什么
Google.api.Auth.dll
pdb已经过时,如何修复?我已经清理并重建了这个项目,但这并没有帮助

UPD

我不得不删除所有与谷歌api相关的pdb。在那之后,我得到了一个错误:

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)

我不完全确定,但我也遇到了同样的错误

我发现如果在使用ilmerge之前重命名ddl,即使我也重命名了pdb,也会出现错误


保留原始文件名为我修复它

pdb(希望)不是您项目的一部分,而是一种依赖关系。可能是GoogleNuGet中附带的pdb真的是无效的——在调用ilmerge并查看是否有帮助之前,我只需删除build文件夹中的pdb。作为一种解决方法,这样做似乎没有问题-实际上,您只会丢失google dll中的异常行号,这似乎很小。我已经删除了与google api相关的pdb,但随后出现了问题正文中描述的错误:您正在创建一个.net核心应用程序,但尚未构建一个自包含的应用程序。我正在创建简单的.net framework单表单应用程序。我将ILMerge作为构建后的一个步骤,并弹出了此问题。根据@Voo的建议,我在调用ILMerge之前将del$(TargetDir)*.pdb添加到后期构建中,解决了这个问题