[英]Compare compiled .NET assemblies?
Are there any good programs out there to compare to compile .NET assemblies?有没有什么好的程序可以比较编译 .NET 程序集?
For example I have HelloWorld.dll (1.0.0.0) and HelloWorld.dll (2.0.0.0), and I want to compare differences how can I do this?例如,我有 HelloWorld.dll (1.0.0.0) 和 HelloWorld.dll (2.0.0.0),我想比较差异我该怎么做?
I know I can use .NET Reflector and use the Assembly Diff plugin.我知道我可以使用 .NET Reflector 并使用 Assembly Diff 插件。 Are there any other good tools out there to do this?
有没有其他好的工具可以做到这一点?
Ways to Compare .NET Assemblies suggests 比较 .NET 组件的方法建议
Commercial:商业的:
Free:自由的:
Existing compare tools like Beyond Compare (commercial) can do this by special configuration. Beyond Compare(商业)等现有的比较工具可以通过特殊配置来做到这一点。 Here's how to do this for Beyond Compare:
以下是如何为 Beyond Compare 执行此操作:
*.exe
or *.dll
*.exe
或*.dll
ildasm
and add %s /OUT:%t /NOBAR
(ie: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\ildasm.exe %s /OUT:%t /NOBAR
)ildasm
的路径并添加%s /OUT:%t /NOBAR
(即: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\ildasm.exe %s /OUT:%t /NOBAR
)exe
files to compare, it should decompile into ilasm
automatically now.exe
文件比较一下,现在应该会自动反编译成ilasm
了。 You can also add syntax highlighting to this new format.您还可以为这种新格式添加语法突出显示。 I plan to send the syntax file to them so that it'll become available to share .
我计划将语法文件发送给他们, 以便共享。
Two ways.两种方式。
You could ILDASM and diff with classic tools.您可以使用经典工具进行 ILDASM 和 diff。
Or you could use NDepends, which will cost for that feature.或者您可以使用 NDepends,这将花费该功能。
[Piece to C# bloaters..] [一块 C# 肿块..]
I just had to compare two revisions of the same DLL, which had the same version (I needed to implement a small hotfix, and deploy the DLL in production, but I wanted to make sure that no other changes leaked into code).我只需要比较相同 DLL 的两个修订版,它们具有相同的版本(我需要实施一个小修补程序,并在生产中部署 DLL,但我想确保没有其他更改泄漏到代码中)。 Ideally, I would want the Assemby Diff add-in to show me the difference, but it does not work (it thinks that I'm comparing a DLL to itself).
理想情况下,我希望 Assemby Diff 加载项向我展示差异,但它不起作用(它认为我正在将 DLL 与自身进行比较)。 So this is what I did:
所以这就是我所做的:
It's a bit kludgy, but seems to work.这有点笨拙,但似乎有效。 I wish the Assembly Diff add-in worked, though.
不过,我希望 Assembly Diff 插件能够正常工作。
UPDATE: The latest version of the Assembly Diff add-in is supposed to fix the issue of comparing two versions of the same assembly.更新:Assembly Diff 插件的最新版本应该解决比较同一程序集的两个版本的问题。 Give it a try.
试试看。
The tool NDepend offers many features to handle .NET code diff. NDepend工具提供了许多功能来处理 .NET 代码差异。 Disclaimer: I am one of the developer of the tool .
免责声明:我是该工具的开发人员之一。
The panel Search by Change is dedicated to browse assemblies code diff. Search by Change面板专用于浏览程序集代码差异。 Notice that:
请注意:
Notice also in the screenshot that a CQLinq code query is generated to browse the diff.另请注意,在屏幕截图中生成了一个CQLinq 代码查询来浏览差异。
from m in Application.Methods
where m.CodeWasChanged()
select new { m, m.NbLinesOfCode }
Many others default diff queries and rules are proposed by default, that will let you browse .NET code diff in a smart way.默认情况下提出了许多其他默认差异查询和规则,这将使您以智能的方式浏览 .NET 代码差异。
One more option is LibCheck from Microsoft.另一种选择是来自 Microsoft 的LibCheck 。
Pretty old console tool for just getting public API diff.用于公开 API 差异的相当旧的控制台工具。 I could not run without debugging and retargeting to a more recent .net version.
如果没有调试和重新定位到更新的 .net 版本,我就无法运行。 However, it gave me very clear output and I am going to use it later.
但是,它给了我非常清楚的 output ,我将在以后使用它。
Java has a nice one: Semantic Diff Utilities Java 有一个不错的: Semantic Diff Utilities
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.