Академический Документы
Профессиональный Документы
Культура Документы
Building C# Applications
1
Objectives
Command Line Compilation
Visual Studio .NET IDE
Referencing External Assemblies
Demo Multi Language
2
Configuration for csc
Right Click My Computer Properties
Advanced Environment variables Double Click
Path
3
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
8
CSC.exe Response Files
These are used as an alternative to
pounding out lines & lines of flags
manually at the command prompt
csc.rsp is the default response file
To disable automatic reading of
csc.rsp, specify /noconfig flag
csc @ TestApp.rsr /noconfig
9
Generating Bug Reports
C# provides flag /bugreport
It include any errors encountered during the
compilation process of current build
csc /bugreport:bugs.txt TestApp.cs
Open bug report in *.txt file (i.e. bugs.txt)
10
Command Line Debugger
(cordbg.exe)
.NET SDK provide command line debugger
cordbg.exe
It provides several flags, to view flags
cordbg-?
b[reak] set or display current break points
del[ete] Remove one or more break points
ex[it] exit debugger
g[o] continue debugging etc.
Generate debugging by specifying - /debug flag
csc @ TestApp.rsp /debug
It generates new file TestApp.pdb
Open a session with cordbg.exe
c:\>cordbg.exe TestApp.exe
11
Program to illustrate command
line arguments
using System; Argvalue=double.Parse(args[0].ToString());
class CommandLine
{ Sqrtvalue=Math.Sqrt(argvalue);
static void Main(string[ ] args)
Console.WriteLine(Square root of the
{
argument is : {0}\n, sqrtvalue);
double argvalue=0.0;
}
double sqrtvalue=0.0; }
if(args.Length==0)
{
Console.WriteLine(No arguments);
Console.ReadLine();
} return;
12
Visual Studio .NET IDE
.NET Start Page
13
.NET Project Window
14
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)
15
.NET Main Page Solution
Tool Explorer
Box View
Class
View
16
Configuring a C# Project
17
Referencing External Assemblies
These are predefined list of assemblies
automatically recognized by .NET
18
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
19
Web Sites for Other IDEs
www.gotdotnet.com
www.icsharpcode.net
20