.NET
  Home arrow .NET arrow Page 5 - Visual C# .NET Part 2: Compiling .NET Code
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Visual C# .NET Part 2: Compiling .NET Code
By: Michael Youssef
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 47
    2004-06-02

    Table of Contents:
  • Visual C# .NET Part 2: Compiling .NET Code
  • Managed Code vs. Unmanaged Code
  • .NET Framework and .NET Languages
  • Visual Studio.NET and .NET Languages
  • Compiling the Application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Visual C# .NET Part 2: Compiling .NET Code - Compiling the Application


    (Page 5 of 5 )

    To compile the application, you will use the csc compiler; this compiler must run from a command-prompt with the Path environment set to access the .NET Framework programs, tools, and libraries. And because I assume that you don’t know what the Path environment is and how to set it up, I will use the Visual Studio.NET Command Prompt.

    Important Note: To compile this application, you must put that file in the same hard disk drive that you will run the command prompt from. For example, if you will run your command prompt from d:/> then your file must be there in drive d.  
      
    Instead of setting up the Path environment manually, we will use VS.NET to set up the Path Environment the ‘Visual Studio.NET Command Prompt’. To find this option click on start menu -> Programs -> Microsoft Visual Studio.NET -> Visual Studio.NET Tools and click on ‘Visual Studio.NET Command Prompt’. This option will open the command-Prompt window and set up the Path Environment for you.  Now we are ready to compile the application.

    In the ‘Visual Studio.NET Command Prompt’ write the following line of code:

    csc test.cs /reference:System.dll

    And then press enter. You will find your new C# program compiled in the same directory that you run the command-prompt from with the same name of the compiled file (test.cs) but with a different extension (it will be test.exe). If you click this program, it will run and ask you about your name. After you type your name, you will get another line of code. Figure 4 illustrates compiling the application:

    When you press Enter key, you will get the next message illustrated by Figure 5:

    youssef

    I compiled my application in drive d, so if your application compiled in drive d too, open it and click on the application icon to execute it.
     
    Did you see how many steps to create very simple application with the command-line compiler? Actually we will not use it again and we will use VS.NET to create all of our applications. That will save a lot of time.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    .NET ARTICLES

    - Building Applications with Windows Workflow ...
    - Building the Data and Business Layers Using ...
    - The Transformed XML Explorer in MFC
    - List Control and Property Grid with the MFC ...
    - Font, Shell and Masked Edit Controls for MFC
    - Color, Link and Image Editor Controls for M...
    - New Controls for MFC
    - The Windows Ribbon Framework
    - Markup Language for the Ribbon Framework
    - Visually Upgrade Your MFC Project
    - New Features for the Statusbar in MFC
    - Working with the Statusbar in MFC
    - Iron Speed Design v60 Review
    - Binary and XML Serialization
    - Using CrystalReportViewer to Display Crystal...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek