Alternatives to Visual Studio

As we have seen, in theory, we can do without Visual Studio, but in practice that is not a good idea. The work required compiling a big project, finding all the errors in the code and performing numerous other actions would simply take too much time without Visual Studio.

On the other hand, Visual Studio is not a free software developing environment (the full version). Many people cannot afford to buy the professional version (this is also true for small companies and some people engaged in programming).

This is why there are some alternatives to Visual Studio (except VS Express Edition), which are free and can handle the same tasks relatively well.

SharpDevelop

One alternative is SharpDevelop (#Develop). We can find it at the following Internet address: http://www.icsharpcode.NET/OpenSource/SD/. #Develop is an IDE for C# and is developed as an open-source project. It supports the majority of the functionalities offered in Visual Studio 2012 but also works in Linux and other operating systems. We will not review it in details but you should keep it in mind, in case you need a C# development environment and Visual Studio is not available.

MonoDevelop

MonoDevelop is an integrated software development environment for the .NET platform. It is completely free (open source) and can be downloaded at: http://monodevelop.com. With MonoDevelop, we can quickly and easily write fully functional desktop and ASP.NET applications for Linux, Mac OS X and Windows. It also enables programmers to easily transfer projects created in Visual Studio to the Mono platform and make them functional in other platforms.

Decompiling Code

Sometimes programmers need to see the code of a given module or program, not written by them and with no source code available. The process, which generates source code from an existing executable binary file (.NET assembly – .exe or .dll) is called decompiling.

We might need to decompile code in the following cases:

Visual Studio. The first popular .NET decompiler was Red Gate’s Reflector (before it became commercial in early 2011).

Telerik is offering a good and completely free .NET decompiler called JustDecompile. It can be downloaded from the company’s website: http://www.telerik.com/products/decompiler.aspx. JustDecompile allows code decompilation directly in Visual Studio and also has an external stand-alone GUI application for browsing assemblies and decompile their code:

Another good decompilation tool for .NET is the ILSpy, which is developed around the SharpDevelop project. ILSpy can be downloaded at: http://ilspy.net. The program does not require installation. After we start it, ILSpy loads some of the standard .NET Framework libraries. Via the menu File -> Open, we can open a certain .NET assembly. We can also load an assembly from the GAC (Global Assembly Cache). This is how ILSpy looks like:

In ILSpy there are two ways to find out how a given method is implemented. For example, if we want to see how the static method System.Currency.ToDecimal works, first we can use the tree on the left to find the Currency class in the System namespace and finally select the ToDecimal method. If we click on any method, we will be able to see its source code in C#. Another way to find a given class is using the search engine in ILSpy. It searches through the names of all classes, interfaces, methods, properties etc. from the loaded assemblies. Unfortunately, the version at the time of writing of this book (ILSpy 2.1) can decompile only the languages C#, VB.NET and IL.

JustDecompile and ILSpy are extremely useful tools, which can help almost every day when developing .NET software and we should definitely download at least one and play with it. When we are wondering how a certain method works or how something is implemented in a given assembly, we can always rely on the decompiler to find out.