Product Reviews

Review: Peek at Someone Else's Code with Red Gate Reflector

When all you have is a DLL or an EXE, .NET Reflector will let you recreate C# or Visual Basic code from the assembly. But the real story here is the .NET Reflector integration with Visual Studio.

.NET Reflector is a decompiler and class browser that has helped developers examine .NET assemblies and methods since the launch of the Microsoft .NET Framework. The standalone tool lets you open a DLL or EXE and, assuming the assembly hasn't been obfuscated, recreate its C# or Visual Basic code. You can learn a lot from other people's code -- including code from Microsoft.

Originally developed by Lutz Roeder as a free tool, .NET Reflector was bought by Red Gate Software Ltd. in 2008. The size and speed of changes in the .NET Framework likely made it impossible for a single developer, working part time, to keep .NET Reflector up-to-date, let alone extend it in new ways.

Originally, Red Gate intended to continue to make the community edition of .NET Reflector available as a free standalone product and use it as a "loss leader" to drive sales of the Visual Studio add-ins and other Red Gate .NET and SQL Server products. Those "follow on" sales didn't materialize.

Red Gate now offers three "for purchase" versions of .NET Reflector 7, which shipped in March. The pricing for .NET Reflector 7 ranges from $35 for the standalone Windows app to $65 for the Visual Studio plug-in (VS), to $95 for a Visual Studio Professional add-in (VSPro) that supports debugging assemblies without the source code. (After an expiration strategy met resistance, Red Gate announced that .NET Reflector 6.x users can upgrade to the last free version, 6.8, which was released in May with a perpetual license.)


[Click on image for larger view.]
Figure 1. Integration with Visual Studio: With .NET Reflector VSPro, you can treat decompiled code just like any other code for debugging purposes.

Visual Studio Integration
While Red Gate has made .NET Reflector fully compatible with the .NET Framework 4, it's the integration with Visual Studio (in the VS and VSPro versions) that's the real step forward. For instance, to find the method you're working with, you no longer have to go searching through decompiled code. Now you can right-click on the method call and pick Open in .NET Reflector to explore the class in the .NET Reflector standalone UI.

But the real power is in VSPro when you're debugging code. Once you've decompiled the assembly (just right-click on the assembly in Solution Explorer), you get full debugging access to the decompiled code, including setting breakpoints, using Go To Definition and examining/setting variables. Speed can be an issue, however, because .NET Reflector decompiles the whole assembly, not just the class or method that you're invoking.

Installation isn't quite standard; there are no .msi or setup.exe files. Instead you run the Reflector.exe application, which asks you which version of the .NET Framework you want .NET Reflector to support. After starting .NET Reflector in standalone mode, you can turn on integration with as many versions of Visual Studio as you have installed. You can also activate Windows Explorer integration, which allows you to decompile assemblies by right-clicking on them in Windows Explorer.

Now that people are willing to pay money for .NET Reflector (or have no choice), other companies are entering the market. JetBrains is building a .NET decompiler (in preview now as the free standalone tool dotPeek) into its ReSharper product. And Telerik is introducing JustDecompile, currently in beta, as a free standalone tool later this summer. However, providing a better product than .NET Reflector is going to require hitting a moving target: Red Gate is currently issuing point releases every four weeks.

.NET Reflector

Red Gate Software Ltd.
Web:
redgate.com
Phone: 866-997-0397
Price: Standard $35; VS $65; VSPro $95
Quick Facts: Decompiles non-obfuscated assemblies into C# or Visual Basic code
Pros: The VSPro version integrates with Visual Studio and allows you to debug decompiled assemblies
Cons: Still, fundamentally, a standalone product with quick start options from Visual Studio



About the Author

Peter Vogel is a system architect and principal in PH&V Information Services. PH&V provides full-stack consulting from UX design through object modeling to database design. Peter tweets about his VSM columns with the hashtag #vogelarticles. His blog posts on user experience design can be found at http://blog.learningtree.com/tag/ui/.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube