WinForms FAQ - Metadata Viewers

How do I create a dll/exe off a previously diassembled .il file?

You can create a dll/exe from the il file using the ilasm.exe utility. This utility is usually installed in the C:\WINNT\Microsoft.NET\Framework\v1.0.3705 (or the appropriate version no.) directory.

If you want to run this utility via command line it would help if you add the above path to your Environment Path variable.

Here is an example command line:

// The .res resource file is optional
ilasm TextProcessing.il /dll /output:TextProcessing.dll /resource:TextProcessing.res
Permalink
How do I disassemble a .net assembly (dll/exe) into the IL format?

You can covert a dll into it’s IL using the ildasm.exe utility. This is usually installed in:
C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin

If you want to run this utility via command line it would help if you add the above path to your Environment Path variable.

Here is a sample command line that will disassemble a dll:

ildasm MyFile.exe /output:MyFile.il

You can reassemble the above il after making some minor changes via the ilasm utility. This is usually done to make some minor changes to an assembly like modifying the version no. of another assembly to which it links to.

Permalink
How can I launch ILDASM from the VS.NET 2003 IDE?

Launch VS.NET and choose Tools->External Tools->Add and add settings as show below:

Title: ILDASM (or anything else of your choice)
Command: C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\ildasm.exe
Arguments: $(TargetPath)
Initial Directory: $(TargetDir)
Use Output Window: unchecked
Prompt for arguments: unchecked
Close on exit: checked.

Permalink
Are there any tools that allow me to view the rich meta data that .NET assemblies have? Is there a OLEVIEW equivalent for .NET?

Currently, the best one that I know of is the Reflector for .NET by Lutz Roeder. You can find it here along with other useful tools.

Reflector for .NET

You can also use the Windows Class Viewer (wincv.exe) and ILDASM (ildasm), both of which come with the .NET framework.

Permalink