All the articles with the tag "反射".
CallerFilePath 只能在编译期拿到调用点的位置,如果你想在运行时拿到任意方法的源文件路径和行号,Portable PDB 提供了另一条路。本文用 System.Reflection.Metadata 演示完整实现。