Sta accadendo qualcosa di strano nel mio codice in cui sto usando uno StackTrace. È quasi come se le informazioni di debug non vengano caricate ... ma lo sto eseguendo sul build DEBUG. I file .pdb sono definitelly nella directory bin e aggiornati. Ho seriamente finito i ideeas:StackTrace nome file sconosciuto
public class TraceHelper
{
private static IDictionary<string,int> TraceDictionary = new Dictionary<string,int>();
public TraceHelper(int duration)
{
...
TraceDictionary[InternalGetCallingLocation()]+=duration;
...
}
public static string InternalGetCallingLocation()
{
var trace = new System.Diagnostics.StackTrace();
var frames = trace.GetFrames();
var filename = frames[1].GetFileName(); //<<-- this always returns null
return frames[0].ToString(); //this returns:
// "InternalGetCallingLocation at offset 99 in file:line:column <filename unknown>:0:0"
}
}
Puoi mostrare la traccia completa? Serve più contesto per aiutare. – Richard