Determine type of T in Generic Method when debugging.
If you are debugging a generic method, is there any way to tell what type T is ?
e.g.
void Main() { GenericMethod<String>(); } public void GenericMethod<T>() { var prop = typeof(T).GetProperties().Dump(); }
I tried adding typeof(T)
in the watch window but it doesn't work.
Comments
The latest LINQPad 8 beta now shows type parameters in the debugger's Threads and Call Stack windows. Let me know whether this works for you.
Yes this works.
Thank you very much.