简体   繁体   中英

Dump C# solution structure to a text file

I would like to dump the structure of my C# solution to a text file or some other output available.

In a solution I have 72 projects and I would like to dump this structure in a fashion similar to the following:


  • Namespace
    • Classes
      • Methods
        • Call hierarchy (the fully qualified caller that invokes said method)

The structure does not have to look exactly like this. As long as I can have some way of determining how what interacts with each other and the fully qualified names of all the projects and classes that exist in a said solution.

The reason for wanting this is so that I can have the current structure documented (even if it is not fully documented) before I can start extracting the different projects in to relative solutions.

.sln and .csproj files are clear text - I suspect you could just:
1. Open the .sln file
2. Read and parse all Project - EndProject sections (get the .csproj relative
location)
3. Open each .csproj file (XML)
4. Select all ItemGroup tags
5. Content / Compile sub-tags, read Include attriubte for file name

Hope this is useful, S

Answer as per YS in comments:

See Sandcastle Help File Builder on GitHub as well as the related post on SO here .

Thanks again for the better solution to my dilemma @YS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM