是否有用于 C# 逆向工程的好工具?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1714438/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 20:12:15  来源:igfitidea点击:

Are there good tools for C# reverse engineering?

c#umlreverse-engineeringmodeling

提问by martin

can you say me if there are good tools for reverse-engineering my C# applications. I need UML-class-diagrams of my written software and i don't want to draw these diagrams by myself. I've already tested StarUML but it didn't work because I used generics an something.

你能告诉我是否有好的工具可以对我的 C# 应用程序进行逆向工程。我需要我编写的软件的 UML 类图,我不想自己绘制这些图。我已经测试过 StarUML 但它没有用,因为我使用了泛型。

Would be great if there a some advices.

如果有一些建议会很棒。

Greetings, Martin

问候, 马丁

采纳答案by Ian

Have you checked out .NET reflector? Has a diagramplugin too..

您是否检查过 .NET 反射器?也有图表插件..

List of Add-Ins

加载项列表

回答by softveda

Sparx enterprise architectis very good. I use it at my work.

Sparx 企业架构师非常好。我在工作中使用它。

回答by Ian Gibson

Coincidentally enough a colleague of had a meeting with some MS guys regarding Visual Studio 2010 team foundation server. They told him that it has the ability to reverse engineer your assemblies and produce UML diagrams. A quick look on MSDN (link text) seems to partially confirm this. It doesn't say UML but it confirms architectural diagrams can be derived and your code which can be validated against at compile time. But it's obviously not available yet and I'm sure it will carry a hefty price tag.

巧合的是,一位同事与一些 MS 人员就 Visual Studio 2010 团队基础服务器进行了会面。他们告诉他,它有能力对你的程序集进行逆向工程并生成 UML 图。快速浏览 MSDN(链接文本)似乎部分证实了这一点。它没有说 UML,但它确认可以派生架构图,并且可以在编译时验证您的代码。但它显然还没有上市,我相信它的价格会很高。

回答by Esther Fan - MSFT

Visual Studio 2010 Ultimate supports UML class diagrams as well as sequence, component, use case, and activity diagrams. It also supports creating sequence, dependency graphs, and layer diagrams from code. Regarding your question about generating UML diagrams from code, there's a response here in the VS Architecture & Modeling tools forum: Is it possible to reverse engineer C# code into an UML Class Diagram?

Visual Studio 2010 Ultimate 支持 UML 类图以及序列、组件、用例和活动图。它还支持从代码创建序列、依赖图和层图。关于从代码生成 UML 图的问题,VS 架构和建模工具论坛中有一个回复:Is it possible to reverse engineering C# code into an UML Class Diagram?

Other tools include Architecture Explorer, which lets you browse and explore your solution.

其他工具包括 Architecture Explorer,可让您浏览和探索您的解决方案。

For more info, see the following links:

有关更多信息,请参阅以下链接:

To download the RC release, visit: Microsoft Visual Studio 2010 Ultimate RC

要下载 RC 版本,请访问:Microsoft Visual Studio 2010 Ultimate RC

To see the RC documentation, see Modeling the Application.

要查看 RC 文档,请参阅建模应用程序

To discuss these tools, visit the Visual Studio 2010 Architectural Discovery & Modeling Toolsforum.

要讨论这些工具,请访问Visual Studio 2010 Architectural Discovery & Modeling Tools论坛。

回答by Patrick from NDepend team

The NDepend tool is certainly what you are looking for C# code reverse engineering. NDepend comes with a dependency graphcoupled with a dependency matrix. You can try NDepend straight on your code thanks to a Free Trial Edition. As a picture is worth a thousands words, see NDepend's screenshoots extracted from this blog post: Interactive Code Dependencies Graph

NDepend 工具无疑是您正在寻找的C# 代码逆向工程。NDepend 带有一个依赖关系图和一个依赖矩阵。由于免费试用版,您可以直接在您的代码上试用 NDepend 。由于一张图片值一千字,请参阅从这篇博文中提取的 NDepend 截图:Interactive Code Dependencies Graph

alt text http://codebetter.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/patricksmacchia.Graph/InternalDependenciesGraphSmall2.jpg

替代文字 http://codebetter.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/patricksmacchia.Graph/InternalDependenciesGraphSmall2.jpg

alt text

替代文字

alt text http://codebetter.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/patricksmacchia.Graph/CycleGraphSmall2.jpg

替代文字 http://codebetter.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/patricksmacchia.Graph/CycleGraphSmall2.jpg

alt text http://codebetter.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/patricksmacchia.CQLExport/Graph1.jpg

替代文字 http://codebetter.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/patricksmacchia.CQLExport/Graph1.jpg

回答by VRC

ILSpy looks alot like Reflector.
http://wiki.sharpdevelop.net/ILSpy.ashx
I've used it many times and it's very handy.

ILSpy 看起来很像 Reflector。
http://wiki.sharpdevelop.net/ILSpy.ashx
我用过很多次了,非常好用。

There's also dotPeek(Creators of Resharper)
http://www.jetbrains.com/decompiler/index.html?topDP

还有 dotPeek(Creators of Resharper)
http://www.jetbrains.com/decompiler/index.html?topDP

They Are both free :D

他们都是免费的 :D