我尝试使用Costura.Fody将DLL文件嵌入到exe文件中。首先,我通过在包管理器控制台中运行此命令来安装Costura.Fody:install-package Costura.Fody
,然后构建项目。但是建设项目不成功,这是建设项目的错误:
Severity Code Description Project File Line
Error Fody: An unhandled exception occurred:
Exception:
Unknown custom metadata item kind: 6
StackTrace:
at Microsoft.Cci.Pdb.PdbFunction.ReadCustomMetadata(BitAccess bits)
at Microsoft.Cci.Pdb.PdbFunction..ctor(ManProcSym proc, BitAccess bits)
at Microsoft.Cci.Pdb.PdbFunction.LoadManagedFunctions(BitAccess bits, UInt32 limit, Boolean readStrings)
at Microsoft.Cci.Pdb.PdbFile.LoadFuncsFromDbiModule(BitAccess bits, DbiModuleInfo info, IntHashTable names, ArrayList funcList, Boolean readStrings, MsfDirectory dir, Dictionary`2 nameIndex, PdbReader reader)
at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, Dictionary`2& tokenToSourceMapping, String& sourceServerData, Int32& age, Guid& guid)
at Mono.Cecil.Pdb.PdbReader.PopulateFunctions()
at Mono.Cecil.Pdb.PdbReader.ProcessDebugHeader(ImageDebugDirectory directory, Byte[] header)
at Mono.Cecil.ModuleDefinition.ProcessDebugHeader()
at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader)
at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
at Mono.Cecil.ModuleReader.CreateModuleFrom(Image image, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at InnerWeaver.ReadModule() in c:\TeamCity\buildAgent\work\7495521761d392b9\FodyIsolated\ModuleReader.cs:line 14
at InnerWeaver.Execute() in c:\TeamCity\buildAgent\work\7495521761d392b9\FodyIsolated\InnerWeaver.cs:line 28
Source:
Mono.Cecil.Pdb
TargetSite:
Void ReadCustomMetadata(Microsoft.Cci.Pdb.BitAccess) WindowsFormsApplication3
我错过了什么吗?
答案 0 :(得分:2)
更新fody包。
update-package Fody