问题
I am running some .NET
.dll
s 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 .dll
s, 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' :)
回答1:
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.
来源:https://stackoverflow.com/questions/19252938/cannot-get-stacktrace-source-line-information-from-mono-dll