简体   繁体   English

将C#解决方案结构转储到文本文件

[英]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. 我想将C#解决方案的结构转储到文本文件或其他可用输出中。

In a solution I have 72 projects and I would like to dump this structure in a fashion similar to the following: 在一个解决方案中,我有72个项目,我想以类似于以下方式的方式转储此结构:


  • 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: .sln和.csproj文件为明文-我怀疑您可以:
1. Open the .sln file 1.打开.sln文件
2. Read and parse all Project - EndProject sections (get the .csproj relative 2.阅读并解析所有Project-EndProject部分(获取相对的.csproj
location) 位置)
3. Open each .csproj file (XML) 3.打开每个.csproj文件(XML)
4. Select all ItemGroup tags 4.选择所有ItemGroup标签
5. Content / Compile sub-tags, read Include attriubte for file name 5.“内容/编译”子标记,请阅读“包括属性”作为文件名

Hope this is useful, S 希望这是有用的,S

Answer as per YS in comments: 根据评论回答YS

See Sandcastle Help File Builder on GitHub as well as the related post on SO here . 请参阅GitHub上的Sandcastle帮助文件生成器以及此处的 SO相关文章。

Thanks again for the better solution to my dilemma @YS 再次感谢您为我的困境提供更好的解决方案@YS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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