……………………………………………….Expertise in .NET Technologies

.NET Framework command-line utilities

Posted by Ravi Varma Thumati on May 20, 2010

While Visual Studio .NET is the most popular method of developing .NET applications, the Framework offers a plethora of command-line tools. In addition, the .NET Framework SDK provides additional command-line tools. In fact, IDEs such as Visual Studio and SharpDevelop often utilize these tools. Let’s take a closer look at the tools installed with the .NET Framework and how you may use them in your projects.

Working with the .NET Framework

The default installation directory for the .NET Framework command-line programs is:

C :\( base Windows directory\Microsoft.NET\Framework\ (framework version), for example


This directory contains numerous .dlls, configuration files, executables, and more. For this article, I concentrate on the executables. Here’s a rundown of these programs:

  • Al.exe: The Assembly Linker generates a file with an assembly manifest from one or more files that are either modules or resource files. A module is a Microsoft intermediate language (MSIL) file that doesn’t have an assembly manifest. All Visual Studio compilers produce assemblies. However, if you have one or more modules (metadata without a manifest), you can use Al.exe to create an assembly with the manifest in a separate file.
  • Aspnet_regiis.exe: This tool allows you to set up ASP.NET on IIS. In addition, it facilitates the use of multiple ASP.NET versions running side-by-side. It allows you to update the script maps for an ASP.NET application to point to the ASP.NET ISAPI version associated with the tool. The tool can also be used to display the status of all installed versions of ASP.NET, register the ASP.NET version coupled with the tool, create client-script directories, and perform other configuration operations.
  • Aspnet_state.exe: This tool allows session state information to be stored on a computer. It runs as a service, and it may be installed on a remote computer if the information is stored there.
  • Caspol.exe: The Code Access Security Policy tool enables users and administrators to modify security policy for the machine policy level, the user policy level, and the enterprise policy level. You can use Caspol.exe to write a batch script that configures security policy.
  • ConfigWizards.exe: This tool launches the .NET Wizards window (Windows Control Panel | Administrative Tools | Microsoft .NET Framework Wizards 1.1). It provides access to three tools: Adjust .NET Security; Trust An Assembly, and Fix An Application.
  • csc.exe: The Visual C# compiler. The /debug switch enters debug mode.
  • cvtres.exe: The resource-to-object converter. This tool is often used to convert a binary resource file to an object file. Native resources usually start life as an .rc file, get compiled to a .res file using rc.exe, get converted to a .obj file using cvtres.exe, and finally get linked into your native application like every other .obj file.
  • dw15.exe: This drives the error messages that you may see when using the Framework. The messages ask if you’d like to send Microsoft an error report. (Many users accuse this little program of being Microsoft spyware.)
  • Gacutil.exe: The Global Assembly Cache tool is used to manage the assembly cache. You can view the contents of the global cache, as well as add or remove assemblies. To use the utility to list all the assemblies in the Global Assembly Cache (GAC), use the /l switch. (The /i switch installs an assembly and /u removes it.)
  • IEExec.exe: This tool facilitates testing of URL-launched applications, including no-touch deployment applications such as Windows Forms. You use this tool instead of your IDE to debug these applications. It only accepts the URL parameter (e.g., IEExec.exe http://Server/TheApplication.Exe.); it doesn’t permit you to specify the zone setting and the site setting. If you try to specify the zone setting and the site setting, you receive errors.
  • Ilasm.exe: The MSIL Assembler generates a portable executable (PE) file from MSIL assembly language. You can run the resulting executable to determine whether the MSIL performs as expected.
  • Installutil.exe: The Installer tool allows you to install and uninstall server resources by executing the installer components in a specified assembly. This tool works in conjunction with classes in the System.Configuration.Install Namespace. For example, this tool is used when installing a Windows Service.
  • jsc.exe: A JScript .NET compiler. The /debug switch enters debug mode.
  • Migpol.exe: The Migration Policy tool provides the capability of migrating policies between two compatible versions of the .NET Framework.
  • Ngen.exe: The Native Image Generator creates a native image from a managed assembly and installs it into the native image cache on the local computer. The native image cache is a reserved area of the GAC. Once you create a native image for an assembly, the runtime automatically uses that native image each time it runs the assembly.
  • Regasm.exe: The Assembly Registration tool reads the metadata within an assembly and adds the necessary entries to the registry; this allows COM clients to create .NET Framework classes transparently. Once a class is registered, any COM client can use it as though the class were a COM class. The class is registered only once, when the assembly is installed. Instances of classes within the assembly cannot be created from COM until they’re registered.
  • Regsvcs.exe: You may use the service installation tool to load and register an assembly, register and install a type library, or configure services added to a class. Regsvcs.exe requires a source assembly file specified by assemblyFile.dll. This assembly must be signed with a strong name. The strong name tool (Sn.exe) is available in the .NET Framework SDK.
  • vbc.exe: Visual Basic .NET compiler. The /debug switch enters debug mode.
  • vbj.exe: Visual J# .NET compiler. The /debug switch enters debug mode.

These tools run the gamut of .NET development. Most of these tools support command-line switches (i.e., commands preceded by a forward slash). These switches allow you to specify setup options or utilize other facets of the tool (like compilers’ /debug option). You can view a complete listing of a tool’s command-line switch options by entering the command followed by the /? or /help. This provides you with complete syntax information to take full advantage of the utility.


3 Responses to “.NET Framework command-line utilities”

  1. I like your style that you put into your work. Please do move forward with more similar to this.

  2. I got a horrible feeling I had not thanked you for them. Those guys happened to be for that reason very interested to read all of them and now have in reality been making the most of them. Thank you for getting so kind and for getting such tremendous tips millions of individuals are really wanting to learn about.

  3. I¡¯m delighted that I have observed this weblog. Finally something not a junk, which we undergo extremely frequently. The website is lovingly serviced and stored as much as date. So it need to be, thanks for sharing this with us.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: