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

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube