0

I am running some .NET .dlls on Windows Server 2012. The .NET assemblies were compiled from C# code on OS X with Xamarin 4.0. (yeah I know weird setup- but I am a game developer) In general they run perfectly, but when it comes to inspecting Exception information, it's not so good. I am trying to pull info out of an Exception object, but it's all empty. I also tried copying the .mdb files along with the .dlls, and made sure I was building in Debug, and with debug symbols. For example this code

log.Error (ex.ToString ());
var st = new StackTrace(ex, true);
var frame = st.GetFrame(0);
var line = frame.GetFileLineNumber();
log.ErrorFormat ("st: {0}, frame: {1}, line: {2}", st.ToString (), frame.ToString (), line);

Generates output like this, just the method name, basically

System.NullReferenceException: Object reference not set to an instance of an object.
at Mindlube.CD3.RandomMatchMaker.ProcessMatchQueue() [ThreadFiber-1] ERROR Mindlube.CD3.App [(null)] - st:    
at Mindlube.CD3.RandomMatchMaker.ProcessMatchQueue(), frame: ProcessMatchQueue 
at offset 927 in file:line:column <filename unknown>:0:0, line: 0

Any suggestions for getting more detailed Exception information? Using Visual Studio on Windows is not currently an option because I don't have time to re-tool my entire dev environment. So don't say 'use VStudio' :)

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Alex Rice
  • 173
  • 1
  • 8
  • Almost all cases of `NullReferenceException` are the same. Please see "[What is a NullReferenceException in .NET?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-in-net)" for some hints. – John Saunders Oct 13 '13 at 02:38
  • Did you ever get a solution to this? I have the same issue. I set the build output to include full debug information (in Visual Studio) and also ran mono with --debug to no avail. – joelc Apr 22 '15 at 23:25

1 Answers1

2

This is because .NET does not understand mdb files.

Unfortunately there is no tool to convert mdb files to pdb files, your only options would be to either write your own or execute your app using Mono on your Windows machine.

Rolf Bjarne Kvinge
  • 19,253
  • 2
  • 42
  • 86