I use debug - application build, and I would like to get the name of the call string and the file name. However, in the case of a file name, the current frame stores the value null, and the row (column also) numbers are always 0. Why does this happen? Code excerpts:
StackFrame sf = new StackTrace().GetFrame(1); // да, мне нужен *предыдущий* кадр string file = sf.GetFileName(); // здесь null(всегда) string func = sf.GetMethod().Name; // здесь есть имя метода int line = sf.GetFileLineNumber(); // здесь 0(всегда) // и так далее Also, I would like to note that StackFrame for a class constructor always returns the following value as a method name: .ctor It is clear that the abbreviation of the word Constructor (possible), but I would like to get the full name.