Telerik blogs

All the Telerik Just* tools are getting great new features in the Q3 2013 release, and JustDecompile is no exception! JustDecompile has always been fast and free and now is even better than ever!

LINQ Query Reconstruction

When LINQ was introduced into .NET it was a game changer. Almost every developer quickly found opportunities to use this great language construct to make development easier and code more readable. And now JustDecompile has the ability to reconstruct these queries. For example, I created a C# class library that contained the class listed here:

 1: using System;
 2: using System.Collections.Generic;
 3: using System.Linq;
 4:  
 5: namespace LinqLibrary
 6: {
 7:  public class LinqExample
 8:     {
 9:  public int GetNumberOfWords()
 10:         {
 11:  string sentence = @"The quick brown fox jumped over the lazy dog.";
 12:  
 13:             IEnumerable<string> result = from text in sentence
 14:                                          let words = sentence.Split(new char[] { ' ' })
 15:                                          from word in words
 16:                                          select word;
 17:             var numberOfWords = result.Count();
 18:  return numberOfWords;
 19:         }
 20:     }
 21: }

(get sample code)

I compiled this into an assembly and loaded it into JustDecompile. In JustDecompile I navigated to the GetNumberOfWords method I can see that my LINQ query was decompiled with very few changes and is easily understandable (Figure 1)

image

Figure 1 – JustDecompile decompiled my LINQ query

Visual Studio Extension

Most developers will have an assembly in their application that they either downloaded or received from another team in their organization. Ideally these should all work as described. But occasionally in the course of tracking down a bug (or just out of curiosity) we would like to see inside of this assembly. With the Q3 2013 release of JustDecompile developers can now decompile these assemblies directly from Visual Studio; we don’t need to open the tool, find the assembly and load it ourselves. It’s as simple as right clicking on the assembly we want to decompile in the Solution Explorer, right-clicking and selecting “View in JustDecompile” in the context menu (Figure 2):

image

Figure 2 – The “View in JustDecompile” option in the Solution Explorer

JustDecompile will decompile the selected assembly and then display it in the JustDecompile window (Figure 3):

image

Figure 3 – System.Data has been decompiled

VB.NET Improvements

One of the most requested features for JustDecompile is improved VB.NET support. This feature opens up the ability to modify assemblies in a language you are comfortable with. Using this new feature I can select “Visual Basic” from the language drop down listbox and then select “Create Project…” from the “Tools” menu to decompile the assembly into VB.NET and create a new VB.NET project (Figure 4):

image

Figure 4 – Using JustDecompile to build a VB.NET project form a decompiled assembly

JustDecompile will create a VB.NET solution for me that I can open in Visual Studio, modify as needed, recompile and redeploy.

Summary

JustDecompile is a great, fast and free .NET decompilation tool! And the new features introduced in Q3 2013 make this tool even easier and more useful, enabling you to reconstruct LINQ queries and create VB.NET assemblies. Add to that the ability to use JustDecompile easily from Visual Studio and you can see that JustDecompile is clearly the best choice for your .NET decompilation needs!

JustDecompile banner

About the Author

James Bender

is a Developer and has been involved in software development and architecture for almost 20 years. He has built everything from small, single-user applications to Enterprise-scale, multi-user systems. His specialties are .NET development and architecture, TDD, Web Development, cloud computing, and agile development methodologies. James is a Microsoft MVP and the author of two books; "Professional Test Driven Development with C#" which was released in May of 2011 and "Windows 8 Apps with HTML5 and JavaScript" which will be available soon. James has a blog at JamesCBender.com and his Twitter ID is @JamesBender. Google Profile

Comments

Comments are disabled in preview mode.