Download presentation
1
Building C# Applications
Chapter 2 Building C# Applications S. Nandagopalan, B I T
2
Objectives Command Line Compilation Visual Studio .NET IDE
Referencing External Assemblies Demo – Multi Language S. Nandagopalan, B I T
3
Configuration for csc Right Click My Computer Properties Advanced Environment variables Double Click Path Add the path where csc.exe is loaded C:\WINDOWS\Microsoft.NET\Framework\v S. Nandagopalan, B I T
4
Command Line Compilation
Compiling single source file csc /target:exe TestApp.cs or csc TestApp.cs csc C Sharp Compiler /target:exe *.exe console application /target:winexe windows application /out to name the output File Compiling multiple source files csc /r:System.Windows.Forms.dll TestApp.cs Hello.cs S. Nandagopalan, B I T
5
Example (Console based)
// Hello.cs using System; public class Hello { public static void Main(String[ ] args) Console.WriteLine("Hello World"); } S. Nandagopalan, B I T
6
Example (Windows based)
// HelloWin.cs using System; using System.Windows.Forms; public class HelloWin { public static void Main(String[ ] args) Console.WriteLine("Hello World"); MessageBox.Show("Hi, I am now in Windows!"); } S. Nandagopalan, B I T
7
Compiling Multiple Source Files
// Car.cs using System; public class Car { public void Display() MessageBox.Show ("Car Class"); } // HelloDriver.cs using System; public class HelloDriver { public static void Main (String[ ] args) Console.WriteLine ("Hello World"); Car c = new Car(); c.Display(); } csc /r:System.Windows.Forms.dll HelloDriver.cs Car.cs S. Nandagopalan, B I T
8
Visual Studio .NET IDE .NET Start Page S. Nandagopalan, B I T
9
.NET Project Window S. Nandagopalan, B I T
10
Project Types Windows Application Windows Forms Class Library
Builds single file assembly (*.dll) Windows Control Library Same as ActiveX Control ASP .NET Web Application Builds ASP .NET Web Application ASP .NET Web Service .NET Web Service Web Control Library Customized Web Controls Console Application Old Console based Windows Services NT/2000 services (background worker applications) S. Nandagopalan, B I T
11
.NET Main Page Solution Explorer Tool Box View Class View
S. Nandagopalan, B I T
12
Configuring a C# Project
S. Nandagopalan, B I T
13
Referencing External Assemblies
These are predefined list of assemblies automatically recognized by .NET S. Nandagopalan, B I T
14
Other features of .NET IDE
Debugging Breakpoints XML – Related Editing Tools Object Browser Help Menu (F1 is your friend) Documenting the Source Code (XML) C# Preprocessor Directives S. Nandagopalan, B I T
15
Web Sites for Other IDEs
S. Nandagopalan, B I T
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.