1 Write source code c# and saved file with .cs extension 2 C# compiler=> Compile source code to an intermediate language MSIL 3 MSIL is contained in an assembly.exe or .dll extension
Trang 2Introduction to the Visual Studio 2010
Trang 3What you Learn in this chapter?
Visual Studio 2010
Trang 4.Net Framework
[4.0] software development platform
Support several programming languages:
C# ,VB, C++,F#
Common Language Runtime (CLR)
Include NET Framework Class Library(FCL)
Trang 5create application will run in the NET CLR
Why
C# ?
Evolution of the C & C++ languages
Incorporate the best features from other languages & Clearing up their problems
Syntax is simple Directly accessing & manipulating system memory
Trang 6Windows Application
Trang 8Operating system
CPU & other hardware
.NET libraries
Trang 91 Write source code c# and saved file with .cs extension
2 C# compiler=> Compile source code to an intermediate language (MSIL)
3 MSIL is contained in an assembly(.exe or .dll extension)
4 Can use source code or reference NET framework libraries
Trang 105 CLR runs on top of host operating system
6 CLR loads assembly & uses JIT compiler to translate MSIL to native machine code
7 Load NET libraries if need
8 MSIL code can execute on any CPUs if CPU is supported by CLR
Trang 11Powerful, professional Integrated Development
Environment (IDE)
Integrated compiler, debugger,
Other useful tool…
Trang 13Solutions and Projects group the items needed
to create a program or application:
A Solution can contain one or more Project
A Project represents a particular part of a
solution
A Project contains source code file, settings &
resource for application
A Project can contain Class Reference libraries
Etc…
Trang 151 Solution
1 File/New/Project (or Ctrl+ Shift +N)
2 Choose “Visual Studio Solutions” in left panel
3 Enter Name & location solution => click OK
Trang 16You can see “Solution1”
name in the right panel
Trang 171 Right click on Solution1
2 Choose Add item
3 Choose New Project
Trang 18& click OK
Trang 19Many different projects
in the Solution
Trang 20Problem: You don’t
know which Project
that you want to run
1 Right click on Project
2 Choose Set as
StartUp Project
Trang 21Problem: We have
many Window
Computing Platform…
To any PC can run
your Application, you
must config as below
Right click
on Project
& choose Properties
Trang 22Or
Go to menu Project
=> Choose Project
properties
Trang 23Project Properties dialog
Trang 24How to add New Item in the Project
1.Right click on Project 2.Choose Add item
3.Choose New Item
Trang 25Choose any item
Enter name and click
“Add” button
Trang 26AssemblyInfo file Reference NET
libraries
Trang 27Solution Folder content
Trang 28Project Folder content
Trang 29How to build Solution & Project
Build Solution Build Project Batch Build
Trang 30You can check or uncheck
project to build
Build
Trang 321 Choose line you want
to start debugging
2 Go to Debug menu
3 Choose Toggle
Breakpoint or press F9
Trang 33Breakpoint here
Trang 344 Go to Debug
5 Choose Start Debugging or press F5
Also you can clear all Breakpoints
Trang 35You can see The Yellow Line
And the name + value of variables
Trang 36Step Into Step Over Step Out
Trang 37Use
QuickWatch
to see detail information of variable at
runtime
Trang 38QuickWatch Dialog here
Variable’s infor
Trang 39You can change value
of the variable and click
Reevaluate button
Trang 42END