简体   繁体   English

升级Visual Studio后Fody编译错误

[英]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.

相关问题 升级到Visual Studio Update 2后生成错误 - Build error after upgrading to Visual Studio Update 2 升级到Visual Studio 2010后使用'var'时出错 - Error using 'var' after upgrading to Visual Studio 2010 在Visual Studio 2017中使用Fody / Costura和Obfuscar - Usage of Fody/Costura and Obfuscar in Visual Studio 2017 将 C# 扩展升级到版本 1.2.1 后的 Visual Studio Code 错误 - Visual Studio Code error after upgrading C# extension to Version 1.2.1 升级到最新版本的 Visual Studio 2022 并且项目未加载后出错 - Error after upgrading to latest version of Visual Studio 2022 and project is not being loaded 错误CS0012:类型'ConnectionStringSettings'在升级到Visual Studio 2015后未引用的程序集中定义 - error CS0012: The type 'ConnectionStringSettings' is defined in an assembly that is not referenced after upgrading to Visual Studio 2015 将Visual Studio 2017中的.NET Framework从4.0升级到4.6.1后,C#API项目中发生错误 - ERROR in C# API project after upgrading .NET framework from 4.0 to 4.6.1 in Visual Studio 2017 将Visual Studio 2010升级到2013后,日语源代码损坏 - Japanese source code corrupted after upgrading Visual Studio 2010 to 2013 升级到Visual Studio 2012.2后,发布网站停止工作 - Publish website stopped working after upgrading to Visual Studio 2012.2 将Visual Studio升级到15.5后缺少System.Net.Http - Missing System.Net.Http after upgrading Visual Studio to 15.5
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM