0

I want to write a program in c# that extracts Class/Entity complete namespace where it is used in solution/source code with their line number of usage.

Below is the code of mini to get class references without line numbers

var nameSpaces = typeOf(Test).GetTypeInfo().Assembly.GetTypes().ToArray();

//... Here Test is Class

The output will be of program

enter image description here

Saif ullah
  • 21
  • 9
  • 2
    Note that source code lines are not stored in compiled assemblies that do not have debugging information stored (typically those built in Release) – Martin Nov 27 '20 at 09:48
  • then Could suggest me any solution to it? – Saif ullah Nov 27 '20 at 09:52
  • @saifullah regarding your recently closed question about opening a file programmatically (which I cannot comment on because it's closed), you can do what you're after using DTE. For example, https://stackoverflow.com/q/5039226/24874 or https://stackoverflow.com/q/2865909/24874. You'll need to read more about DTE. – Drew Noakes Feb 19 '21 at 07:04

0 Answers0