2. Developing in.NET and C#. 2 Microsoft Objectives “Microsoft.NET development is based on an underlying framework of tools and classes. These tools and.

Slides:



Advertisements
Similar presentations
.NET Framework Overview
Advertisements

pa 1 Porting BETA to ROTOR ROTOR Projects Presentation Day, June by Peter Andersen.
.NET Session Prepared By : Manu Sharma IBE Team. Topics Types of.NET Applications.NET Framework CLR Garbage Collection Importance of.NET.
Wrap-up: Where Do You Go From Here? MicrosoftIntroducing CS using.NETJ# in Visual Studio.NET Objectives “.NET is the future of software development.
.NET Framework Overview Pingping Ma Nov 16 th, 2006.
.NET Overview. 2 Objectives Introduce.NET –overview –languages –libraries –development and execution model Examine simple C# program.
Advanced Object-Oriented Programming Features
Introducing the Common Language Runtime for.NET. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution.
.NET’s CLR How does it really work? 7/2/20151Bhavani Sankar Ikkurthi CS 795 Presentation.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
C# Programming: From Problem Analysis to Program Design1 10 Advanced Object-Oriented Programming Features C# Programming: From Problem Analysis to Program.
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
Lecture 2: An Introduction to J# and.NET. 2 MicrosoftIntroducing CS using.NETJ# in Visual Studio.NET 2-2 Objectives “Microsoft.NET is based on the.NET.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.
Computer Science 317 Database Management Introduction to Web Access to Databases.
1..NET Architecture Based on slides by Joe Hummel.
1 8/29/05CS360 Windows Programming Professor Shereen Khoja.
1 Program Execution in the 21 st Century Modern Software Development in.NET and C# A webcast series for C++, Java, and VB6 developers – Part 1 of 15: [
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
.NET Overview. 2 Objectives Introduce.NET –overview –languages –libraries –development and execution model Examine simple C# program.
C# A 1 CSC 298 Introduction to C#. C# A 2 What to expect in this class  Background: knowledge of an object oriented language of the C++, Java, … family.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
.NET Framework & C#.
Introduction to .NET Framework
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
Bacon A Penetration and Auditing Framework Hernan Gips
Compiling and Executing Code in.Net Microsoft Intermediate Language and Common Language Runtime.
C# B 1 CSC 298 Writing a C# application. C# B 2 A first C# application // Display Hello, world on the screen public class HelloWorld { public static void.
Introduction .NET Framework
FEN 2012 UCN Technology: Computer Science1 C# - Introduction Language Fundamentals in Brief.
Component-Based Software Engineering Introduction to.NET Paul Krause.
1..NET Architecture Based on slides by Joe Hummel.
.NET Framework Danish Sami UG Lead.NetFoundry
Programming in C#. I. Introduction C# (or C-Sharp) is a programming language. C# is used to write software that runs on the.NET Framework. Although C#
Week 1: THE C# LANGUAGE Chapter 1: Variables and Expressions ➤ Included in Visual Studio.NET ➤ What the.NET Framework is and what it contains ➤ How.NET.
Introduction to VB.Net. What is.NET? A brand of Microsoft technologies A platform for creating distributed Web applications A combination of new and updated.
1.NET FRAMEWORK CE-105 Spring 2007 Engr. Faisal ur Rehman.
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Application Foundation Presented By : Naveed Sattar Software Engineer.
Applied Computing Technology Laboratory QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005.
Getting Started with C# August 29, NET Concepts Language Independence Language Integration  your C# program can use a class written in VB Program.
Introduction to.NET. What is.NET? Microsoft’s vision of the future of applications in the Internet age –Increased robustness over classic Windows apps.
.NetDeploymentNOEA / PQC 2005 Application Deployment and Versioning Source: Joe Hummel, kursus i.Net, jan
C# Programming: From Problem Analysis to Program Design1 10 Advanced Object-Oriented Programming Features C# Programming: From Problem Analysis to Program.
Compunet Corporation1 Programming with Visual Basic.NET Fundamentals of Programming Lecture # 1 Tariq Ibn Aziz.
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
Lecture 4: J# Execution Model. 2 MicrosoftIntroducing CS using.NETJ# in Visual Studio.NET 4-2 Objectives “J# programs execute like any other.NET program.
.NET Ying Chen Junwei Chen. What is Microsoft.NET. NET is a development platform Incorporated into.NET COM+ component services ASP web development framework.
1. The .NET Architecture 1. The .NET Architecture 2003
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
July 22, 2001Introduction to.NET1 Introduction to.NET Framework Gholamali Semsarzadeh July 2001.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
METADATA IN.NET Presented By Sukumar Manduva. INTRODUCTION  What is Metadata ? Metadata is a binary information which contains the complete description.
Introduction to the Microsoft.NET Framework Chris Wastchak Student Ambassador to Microsoft.
Lecture 1: The .NET Architecture
Computer System Structures
An Introduction to the Shared Source Common Language Infrastructure (SSCLI) Damien Watkins Copyright Watkins 2002.
“An Introduction to .NET, C# and Visual Studio 2005”
Frank McCown TechLunch Old Dominion University March 28, 2007
C# and the .NET Framework
CE-105 Spring 2007 Engr. Faisal ur Rehman
CS360 Windows Programming
Introduction to C# AKEEL AHMED.
Programming in C# CHAPTER 1
0. Overview of 2-Day Academic .NET Workshop
Frank McCown TechLunch Old Dominion University March 28, 2007
Presentation transcript:

2. Developing in.NET and C#

2 Microsoft Objectives “Microsoft.NET development is based on an underlying framework of tools and classes. These tools and classes are known as the Framework SDK (Software Development Kit).”.NET development options Brief summary of C# Class-based development Component-based development

3 Microsoft Part 1.NET development options…

4 Microsoft Recall assemblies 1 assembly = 1 or more compiled classes –.EXE represents an assembly with classes + Main program –.DLL represents an assembly with classes Development Tools assembly code.vb code.cs.EXE /.DLL

5 Microsoft.NET development There are currently 3 ways to develop assemblies: 1).NET Framework SDK free (100 MB) complete set of command-line tools and docs available for Windows NT, 2000, XP Pro, other platforms? –FreeBSD / Mac OS X via Rotor (i.e. SSCLI) –Linux via Mono project

6 Microsoft Development options, cont'd 2) Visual Studio.NET 5-6 CDs, 192 MB RAM (bare minimum) powerful, integrated development environment (IDE) one IDE for all: GUI, web-based, web service, DLLs, etc. this is what 99% of the world uses $$ –MSDNAA reduces cost to $800/year for unlimited access 3) free IDEs #develop, a simplified clone of VS.NET WebMatrix, for building web-based applications

7 Microsoft Hello World in C# Here's the source code: /* hello.cs */ public class Startup { public static void Main() { System.Console.WriteLine("Hello World!"); } }//class hello.cs

8 Microsoft Why System.Console prefix? In.NET, all code & data must live within a module / class Often nested within namespaces to help organize things –a namespace is really just a named collection Example: System.Console.WriteLine("Hello World!"); Console class WriteLine subroutine System namespace in FCL

9 Microsoft Compiling and running To compile C# with Framework SDK, use the C# compiler –open Visual Studio.NET command prompt window to set path –csc is the command-line C# compiler –use /t:exe option to specify console-based EXE as target To run, simply use name of assembly… c:\> csc /t:exe hello.cs Microsoft (R) Visual C#.NET Compiler version for Microsoft (R).NET Framework version Copyright (C) Microsoft Corporation All rights reserved. c:\> hello.exe Hello World!

10 Microsoft Viewing an assembly with ILDasm IL = Microsoft's Intermediate Language (i.e. generic asm) ILDasm = IL Disassembler c:\> ildasm hello.exe

11 Microsoft IL? Very similar to Java bytecodes: –generic assembly language –stack-based –strictly typed –no direct memory addressing –verifiable for safe execution

12 Microsoft Part 2 Development on FreeBSD…

13 Microsoft Development on FreeBSD Working on FreeBSD is exactly the same! –i.e. same command-line tools as Framework SDK –produces *binary-compatible*.DLL and.EXE files!

14 Microsoft Part 3 Brief summary of C#...

15 Microsoft C# Case-sensitive Strict type-checking Operator and method overloading Single public inheritance; any number of interfaces All classes inherit from object; classes may be nested Garbage-collected Multiple classes may exist in one file Multiple files may be compiled into one assembly Each assembly typically written in one language When in doubt, think Java!

16 Microsoft Part 4 Class-based development…

17 Microsoft A customer class Here's the source code for a simple Customer class: /* customer.cs */ public class Customer { public string Name; // fields public int ID; public Customer(string name, int id) // constructor { this.Name = name; this.ID = id; } public override string ToString() // method { return "Customer: " + this.Name; } }//class

18 Microsoft Main class Here's the source code for Main, using our Customer class: /* main.cs */ public class App { public static void Main() { Customer c; c = new Customer("joe hummel", 94652); System.Console.WriteLine( c.ToString() ); } }//class

19 Microsoft Compiling and running application Compile and run as before… –/out: option specifies name of resulting EXE –in this case we are building monolithic app (single EXE, no DLLs) c:\> csc /t:exe /out:app.exe main.cs customer.cs Microsoft (R) Visual C#.NET Compiler version for Microsoft (R).NET Framework version Copyright (C) Microsoft Corporation All rights reserved. c:\> app.exe Customer: joe hummel

20 Microsoft Part 5 Component-based development…

21 Microsoft Example Let's rebuild previous app based on components –Customer class ==> DLL –Main class ==> EXE app.exe customer.dll + main.cs customer.cs

22 Microsoft Compiling a component Use the C# compiler… –with /t:library option to specify component library as target –csc produces a DLL in this case c:\> csc /t:library customer.cs Microsoft (R) Visual C#.NET Compiler version for Microsoft (R).NET Framework version Copyright (C) Microsoft Corporation All rights reserved. c:\> dir *.dll customer.dll

23 Microsoft Compiling and running application Compile using C# compiler as before, except… –reference component so compiler can locate Customer class! –reference also stored inside assembly so CLR can locate To run, use name of assembly containing Main… –CLR follows reference to locate DLL c:\> csc /t:exe /out:app.exe main.cs /r:customer.dll Microsoft (R) Visual C#.NET Compiler version for Microsoft (R).NET Framework version Copyright (C) Microsoft Corporation All rights reserved. c:\> app.exe Customer: joe hummel

24 Microsoft Where are references stored? Within assembly as part of assembly manifest Visible via ILDasm c:\> ildasm app.exe

25 Microsoft mscorlib? mscorlib = "ms-core-lib" Core FCL assembly –contains core system classes like string –contains System.Console class for console-based I/O Automatically referenced for us by C# compiler…

26 Microsoft Recall CLR-based execution.EXE other FCL assemblies CLR JIT Compiler obj code OS Process Underlying OS and HW Core FCL assembly.DLL obj code All assemblies must be present:

27 Microsoft Summary.NET is multi-language –Framework SDK based on C# and VB.NET –lots of other languages available.NET development is component-based –helper classes implemented in one or more DLLs –EXE implemented using helper classes –if (assembly A uses a class from assembly B) then A must reference B!

28 Microsoft References Books: –J. Richter, "Applied Microsoft.NET Framework Programming" Web sites: – –MSDNAA: –Rotor (SSCLI): –Mono: –Free IDEs: –Anakrino reverse-engineering tool:

29 Microsoft Lab? Work on lab #1, "Architecture"…