Quote Originally Posted by amirabiri 
Is anyone else getting this exception?

Code:  
Unhandled Exception: System.TypeInitializationException: The type initializer for 'Mono.Cecil.Metadata.TableHeap' threw an exception. ---> System.ArgumentException: Value does not fall within the expected range.

at System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(Array array, RuntimeFieldHandle fldHandle)

   at Mono.Cecil.Metadata.TableHeap..cctor()

   --- End of inner exception stack trace ---

   at Mono.Cecil.PE.ImageReader.ReadTableHeap()

   at Mono.Cecil.PE.ImageReader.ReadImage()

   at Mono.Cecil.PE.ImageReader.ReadImageFrom(Stream stream)

   at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters)

   at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)

   at Pdb2Mdb.Driver.Main(String[] args)


This doesn't seem to be related to the to the project, the same thing happens when I run the command from the command line.
 
Quote Originally Posted by TaiChiAnt 
I have the same problem as well. 2.0 pdb2mdb.exe solved this problem but not the IEnumerator Issue. :(
We had the same problems. Using pdb2mdb.exe from 'C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\pdb2mdb. exe' worked as long as we did not use IEnumerator and yield. When our *.dlls contained yield statements, pdb2mdb.exe always crashed with the following stacktrace:
Code:  
System.ArgumentNullException: Argument cannot be null.

Parametername: source

  at System.Linq.Check.SourceAndPredicate (System.Object source, System.Object predicate) [0x00000] in <filename unknown>:0

  at System.Linq.Enumerable.Where[PdbLines] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0

  at Pdb2Mdb.Converter.GetSourceFile (Mono.CompilerServices.SymbolWriter.MonoSymbolWriter mdb, Microsoft.Cci.Pdb.PdbFunction function) [0x00000] in <filename unknown>:0

  at Pdb2Mdb.Converter.ConvertFunction (Microsoft.Cci.Pdb.PdbFunction function) [0x00000] in <filename unknown>:0

  at Pdb2Mdb.Converter.Convert (Mono.Cecil.AssemblyDefinition assembly, IEnumerable`1 functions, Mono.CompilerServices.SymbolWriter.MonoSymbolWriter mdb) [0x00000] in <filename unknown>:0

  at Pdb2Mdb.Driver.Convert (Mono.Cecil.AssemblyDefinition assembly, System.IO.Stream pdb, Mono.CompilerServices.SymbolWriter.MonoSymbolWriter mdb) [0x00000] in <filename unknown>:0


When switching to the other pdb2mdb.exe located at 'C:\Program Files (x86)\Unity\Editor\Data\MonoBleedingEdge\lib\mono\ 4.0\pdb2mdb.exe', it worked for some of our PCs but crashed on others with the error given by amirabiri. Doing some research we found that this is related to the mono version used to execute pdb2mdb.exe. We could fix this issue by using the mono.exe located at 'C:\Program Files (x86)\Unity\Editor\Data\MonoBleedingEdge\bin\mono. exe'. The command looks like (make sure the cwd is where the dll is located)
 
Code:  
"C:\Program Files (x86)\Unity\Editor\Data\MonoBleedingEdge\bin\mono.exe" "C:\Program Files (x86)\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.0\pdb2mdb.exe" Your.dll