[1.1] StackFrame(2).GetFileLineNumber() renvoit 0
Je ne comprend pas quelque chose :
Ceci fonctionne très bien :
Citation:
new System.Diagnostics.StackFrame(2).GetMethod().DeclaringType.Name;
System.Diagnostics.StackFrame(2).GetMethod().Name
Mais ceci pas :
Citation:
new System.Diagnostics.StackFrame(2).GetFileLineNumber();
new System.Diagnostics.StackFrame(2).GetFileName();
donnent respectivement 0 et null, c'est à dire qu'il ne trouve pas...
Y a-t-il des conditions à remplir pour que ça fonctionne ? Je n'en ai pas trouvé sur le MSDN...