How to get Classes and methods from a .cs file using Reflections in C#.?

前端 未结 6 1945
执笔经年
执笔经年 2020-12-12 04:06

How to get the classes that are available in a \'.cs\' file.? Like we can get the classes and methods in an Assembly using,

Assembly.GetTypes() and Type.GetM         


        
6条回答
  •  再見小時候
    2020-12-12 04:41

    The compiler erases all notions of a codefile from your code as it is compiled. That being said perhaps it is possible to retrieve the information you want from debugging symbols if they are available in your assembly.

提交回复
热议问题