Web Design that taps into the haromny and vision of your dreams.

Using Microsoft .Net Command Line Tools

Using the command prompt with Visual Studio

Written By on in C#

376 words, estimated reading time 2 minutes.

Visual Studio provides a set of command-line tools to software engineers to accomplish some tasks that are either not available in the IDE or tools that can be run in batch.

Using Visual Studio Series
  1. Getting Started with Visual Studio
  2. Using the Visual Studio Integrated Development Environment
  3. Using the Visual Studio Debugger
  4. XML Documentation in Visual Studio
  5. Using Microsoft .Net Command Line Tools
  6. What is an Assembly in Microsoft .Net?
  7. Creating and Using a .NET Assembly in C#
  8. Creating and Implementing Satellite Assemblies
  9. Creating Strong Named Assemblies in Microsoft .Net
  10. Visual Studio Task List
  11. Resources and Localisation in C# Projects
  12. Localising Microsoft .Net Applications with C#
  13. Using Resource Files in C# Applications
  14. Using XSD Tool to Generate Classes from XML
  15. 10 Visual Studio Tools You May Not Know About

Some of these tools are essential for distributing applications over the Internet. Listed below are the main tools and essential tools, together with a description and example usage. This is not a comprehensive or definitive list of the tools.

Csc.exe - C Sharp Compiler

Command line compiler tool compiles .cs files to .exe.

Compile to mySource.exe with a target of release:

csc.exe mySource.cs

Compile to mySource.exe with a target of debug:

csc.exe mySource.cs /debug

Compile to Demo.exe:

csc.exe mySource.cs /out:Demo.exe

Compile to mySource.dll:

csc.exe mySource.cs /target:library

Compiles all cs files to exe:

csc.exe *.cs

Display full list of command line parameters:

csc.exe -?

Gacutil.exe - Global Assembly Cache Tool

Command line tool to inspect the current machine's global assembly cache. You can view, install or uninstall assemblies from the GAC with this tool.

List all assemblies currently installed on the machine:

gacutil.exe /l

Install an assembly into the GAC:

gacutil.exe /i myfile.dll

Uninstall an assembly from the GAC:

gacutil.exe /u myfile.dll

Display full list of command line parameters:

gacutil.exe

Ildasm.exe - Intermediate Language Dissembler

Not strictly a command line tool, but not installed onto the start menu. This program will provide a disassembly of a file provided that it is a Portable Executable (PE) executable (generated by the ILASM tool or C# compiler).

The tool will inform you of any references the program has, the classes, methods and data objects in the executable and other debug information.

Ilasm Intermediate Language Assembler

Compile Intermediate Language to Portable Executable (PE)

Compiles to source.exe:

ilasm.exe source.il

Compiles to source.dll

ilasm.exe source.il /dll

compiles to source.exe using keyfilename to strongly signed private key:

ilasm.exe source.il /key:keyfilename

Sn.exe Strong Name Tool

Helps sign assemblies with strong names. It provides options for key management, signature generation and signature verification.

Generate a random key and store it in mykey.snk:

sn -k mykey.snk

Verify an assembly:

sn -v mykey.snk

aspnet_regiis.exe ASP.NET IIS Registration Tool

This tool is used to install, or register, ASP.Net with the IIS server.

aspnet_regiis -i

Last updated on: Friday 23rd June 2017

 

Comments

There are no comments for this post. Be the first!

 

Leave a Reply

Your email address will not be published.





If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.

Copyright © 2001-2018 Tim Trott, all rights reserved. Web Design by Azulia Designs

This web page is licensed for your personal, private, non-commercial use only.

Disclaimer, Privacy & LegalSitemapContact Me