[英]Fody compile error after upgrading Visual Studio
My program used to compile just fine in VS2013. 我的程序过去在VS2013中可以正常编译。 After upgrading to VS2015 enterprise edition, when I try to compile the program, it says:
升级到VS2015企业版后,当我尝试编译该程序时,它说:
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) ChampionsGG
I have never used fody before and never heard of it before, so i'm not sure why it would be using this. 我以前从未使用过姿势,也从未听说过它,所以我不确定为什么会使用它。 After checking the packages file there was 2 packages, Fody and Costura.Fody but I don't remember putting it there.
在检查软件包文件之后,有2个软件包,Fody和Costura.Fody,但是我不记得把它放在那里了。 I removed both lines and recompiled but the error still occurs.
我删除了这两行并重新编译,但错误仍然出现。
Does anyone know why this is happening? 有人知道为什么会这样吗?
I had the same problem after upgrading from VS 2012 with an old version of Fody (1.26) to VS 2015 with the latest Fody (1.29.4). 从带有旧版本Fody(1.26)的VS 2012升级到带有最新Fody(1.29.4)的VS 2015后,我遇到了同样的问题。
So I uninstalled Fody entirely but then I got a build error from my old Fody, which should no longer have been there. 因此,我完全卸载了Fody,但是后来我的旧Fody出现了构建错误,该错误不再存在。
I looked in the csproj file and saw that 2 lines about my old Fody were left. 我查看了csproj文件,发现剩下两行关于我的旧Fody的信息。 I commented them out, then re-installed the latest Fody, and then everything worked again.
我将它们注释掉,然后重新安装了最新的Fody,然后一切恢复正常。
Seems to be a known issue of Fody. 似乎是Fody的已知问题。 You seem to use TeamCity to build your solution.
您似乎在使用TeamCity构建解决方案。 I am no TeamCity expert but the exception comes from a MS pdb parser which is used by Mono Cecil which is used by TeamCity to do ... things.
我不是TeamCity专家,但例外来自Mono Cecil使用的MS pdb解析器,TeamCity使用该解析器来做某事。
Check out this issue of Fody: https://github.com/Fody/Fody/issues/187 看看Fody的这个问题: https : //github.com/Fody/Fody/issues/187
Either wait for TeamCity to update Fody or update it by yourself or remove the custom MSBuild task which triggers the TeamCity activity. 等待TeamCity更新Fody或自己更新Fody,或者删除触发TeamCity活动的自定义MSBuild任务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.