Fody exception in release mode. Symbol file .dll.mdb does not match the .dll assembly

I am having trouble creating a PCL in Xamarin Studio on Mac. It works fine in debug mode, but fody throws an exception in Release mode.

An exception during assembly is shown below.

Error: Fody: An unhandled exception occurred: Exception: Symbol file `XXX/obj/Release/XXX.dll.mdb' does not match assembly `XXX/obj/Release/XXX.dll' StackTrace: at Mono.CompilerServices.SymbolWriter.MonoSymbolFile.CheckGuidMatch (Guid other, System.String filename, System.String assembly) [0x00000] in <filename unknown>:0 at Mono.CompilerServices.SymbolWriter.MonoSymbolFile..ctor (System.String filename, Mono.Cecil.ModuleDefinition module) [0x00000] in <filename unknown>:0 at Mono.CompilerServices.SymbolWriter.MonoSymbolFile.ReadSymbolFile (Mono.Cecil.ModuleDefinition module, System.String filename) [0x00000] in <filename unknown>:0 at Mono.Cecil.Mdb.MdbReaderProvider.GetSymbolReader (Mono.Cecil.ModuleDefinition module, System.String fileName) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleReader.ReadSymbols (Mono.Cecil.ModuleDefinition module, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleReader.CreateModuleFrom (Mono.Cecil.PE.Image image, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at InnerWeaver.ReadModule () [0x00000] in <filename unknown>:0 at InnerWeaver.Execute () [0x00000] in <filename unknown>:0 Source: Mono.Cecil.Mdb TargetSite: Void CheckGuidMatch(System.Guid, System.String, System.String) 
+7
c # xamarin fody fody-propertychanged
source share
2 answers

Fody needs debugging information (* .mdb file) associated with the output assembly to complete the weaving phase. The release of the assembly by default disables the Debug information field inside AssemblyCompiler in the project settings.

If this build option is set to None , disables debugging symbology and causes the mdb file to fail, therefore the Symbol file 'XXX/obj/Release/XXX.dll.mdb' does not match assembly XXX/obj/Release/XXX.dll exception Symbol file 'XXX/obj/Release/XXX.dll.mdb' does not match assembly XXX/obj/Release/XXX.dll .

Therefore, when creating projects in release mode, when Fody is integrated into the build process, you need to include Symbols only or Full :

enter image description here

+13
source share

You may already have one, but I would start with this if it were me:

  • Right click on your solution.
  • The properties
  • Configuration Properties / Configuration

In the Configuration drop-down list in the upper left corner, verify that the Debug configuration (re: Platform | Build | Deploy) matches Release.

+1
source share

All Articles