.Net Framework Joel Pereira ([email protected]) Software Design Engineer WinFS API Team...

68
.Net Framework Joel Pereira Joel Pereira ([email protected]) ([email protected]) Software Design Engineer Software Design Engineer WinFS API Team WinFS API Team Microsoft Corporation Microsoft Corporation

Transcript of .Net Framework Joel Pereira ([email protected]) Software Design Engineer WinFS API Team...

Page 1: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

.Net Framework.Net Framework

Joel Pereira ([email protected])Joel Pereira ([email protected])Software Design EngineerSoftware Design EngineerWinFS API TeamWinFS API TeamMicrosoft CorporationMicrosoft Corporation

Page 2: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

AgendaAgenda

Part I - FundamentalsPart I - FundamentalsProgramming ModelsProgramming Models

Design Goals and ArchitectureDesign Goals and Architecture

CLR ServicesCLR Services

Part II – Visual Studio 2005Part II – Visual Studio 2005Extending the PlatformExtending the Platform

Improving the PlatformImproving the Platform

Innovation in the PlatformInnovation in the Platform

Page 3: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Unify Programming ModelsUnify Programming Models

Windows APIWindows API

.NET Framework.NET Framework

Consistent API availability regardless ofConsistent API availability regardless oflanguage and programming modellanguage and programming model

ASPASP

Stateless,Stateless,Code embeddedCode embeddedin HTML pagesin HTML pages

MFC/ATLMFC/ATL

Subclassing,Subclassing,Power,Power,

ExpressivenessExpressiveness

VB FormsVB Forms

RAD,RAD,Composition,Composition,

DelegationDelegation

Page 4: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Make It Simple To UseMake It Simple To Use

OrganizationOrganizationCode organized in hierarchical Code organized in hierarchical namespaces and classesnamespaces and classes

Unified type systemUnified type systemEverything is an object, no variants, one Everything is an object, no variants, one string type, all character data is Unicodestring type, all character data is Unicode

Component OrientedComponent OrientedProperties, methods, events, and attributes Properties, methods, events, and attributes are first class constructsare first class constructs

Design-time functionalityDesign-time functionality

Page 5: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

How Much Simpler?How Much Simpler?

HWND hwndMain = CreateWindowEx(HWND hwndMain = CreateWindowEx( 0, "MainWClass", "Main Window",0, "MainWClass", "Main Window", WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL,WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL, CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT, CW_USEDEFAULT, (HWND)NULL, (HMENU)NULL, hInstance, NULL); (HWND)NULL, (HMENU)NULL, hInstance, NULL); ShowWindow(hwndMain, SW_SHOWDEFAULT); ShowWindow(hwndMain, SW_SHOWDEFAULT); UpdateWindow(hwndMain);UpdateWindow(hwndMain);

Form form = new Form();Form form = new Form();form.Text = "Main Window";form.Text = "Main Window";form.Show();form.Show();

Windows APIWindows API

.NET Framework.NET Framework

Page 6: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Hello World DemoHello World Demo

What you needWhat you need

Page 7: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

AgendaAgenda

Part I - FundamentalsPart I - FundamentalsProgramming ModelsProgramming Models

Design Goals and ArchitectureDesign Goals and Architecture

CLR ServicesCLR Services

Part II – Visual Studio 2005Part II – Visual Studio 2005Extending the PlatformExtending the Platform

Improving the PlatformImproving the Platform

Innovation in the PlatformInnovation in the Platform

Page 8: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Common Language RuntimeDesign GoalsCommon Language RuntimeDesign Goals

Dramatically simplifies development Dramatically simplifies development and deploymentand deployment

Unifies programming modelsUnifies programming models

Provides robust and secure execution Provides robust and secure execution environmentenvironment

Supports multiple programming Supports multiple programming languageslanguages

Page 9: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Architectural OverviewArchitectural Overview

Co

mm

on

Lan

gu

age

Ru

nti

me

Co

mm

on

Lan

gu

age

Ru

nti

me

FrameworkFramework

Class loader and layoutClass loader and layout

GC, stack walk, code managerGC, stack walk, code manager

IL t

o

IL t

o

nat

ive

cod

e n

ativ

e co

de

com

pile

rsco

mp

ilers

Sec

uri

tyS

ecu

rity

Exe

cuti

on

Exe

cuti

on

Su

pp

ort

Su

pp

ort

Base ClassesBase Classes

Page 10: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

AssemblyAssembly

Compilation And ExecutionCompilation And Execution

Source Source CodeCode

Language Language CompilerCompiler

CompilationCompilation

At installation or the At installation or the first time each first time each

method is calledmethod is calledExecutionExecution

JIT JIT CompilerCompiler

NativeNative

CodeCode

Code (IL)Code (IL)

MetadataMetadata

Page 11: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

LanguagesLanguages

The CLR is Language NeutralThe CLR is Language NeutralAll languages are first class playersAll languages are first class players

You can leverage your existing skillsYou can leverage your existing skills

Common Language SpecificationCommon Language SpecificationSet of features guaranteed to be in all Set of features guaranteed to be in all languageslanguages

We are providingWe are providingVB, C++, C#, J#, JScriptVB, C++, C#, J#, JScript

Third-parties are buildingThird-parties are buildingAPL, COBOL, Pascal, Eiffel, Haskell, ML, APL, COBOL, Pascal, Eiffel, Haskell, ML, Oberon, Perl, Python, Scheme, Smalltalk…Oberon, Perl, Python, Scheme, Smalltalk…

Page 12: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Hello World DemoHello World Demo

What you needWhat you need

MSILMSIL

Page 13: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

AgendaAgenda

Part I - FundamentalsPart I - FundamentalsProgramming ModelsProgramming Models

Design Goals and ArchitectureDesign Goals and Architecture

CLR ServicesCLR Services

Part II – Visual Studio 2005Part II – Visual Studio 2005Extending the PlatformExtending the Platform

Improving the PlatformImproving the Platform

Innovation in the PlatformInnovation in the Platform

Page 14: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Component-Based ProgrammingComponent-Based Programming

3 core technologies make building and 3 core technologies make building and using components easyusing components easy

Type safetyType safety

Automatic memory managementAutomatic memory management

MetadataMetadata

This greatly simplifies application This greatly simplifies application developmentdevelopment

Page 15: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Type SafetyType Safety

Type safety ensures that objects are used Type safety ensures that objects are used the way they were intended to be usedthe way they were intended to be used

Prevents an object’s state from being corruptedPrevents an object’s state from being corrupted

The CLR enforces type safetyThe CLR enforces type safetyAttempting to coerce an object to an Attempting to coerce an object to an incompatible type causes the CLR to throw an incompatible type causes the CLR to throw an exceptionexception

Type safety means code confidenceType safety means code confidenceCommon programmer errors will be found Common programmer errors will be found immediatelyimmediatelyRectangle(hwnd, 0, 0, 10, 10);Rectangle(hwnd, 0, 0, 10, 10);

//hwnd should be an hdc//hwnd should be an hdc

MessageBox(hwnd, “”, “”, IDOK);MessageBox(hwnd, “”, “”, IDOK);

//IDOK should be MB_OK//IDOK should be MB_OK

Page 16: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Automatic Memory ManagementAutomatic Memory Management

The CLR tracks the code’s use of objects and The CLR tracks the code’s use of objects and ensuresensures

Objects are not freed while still in use (no memory Objects are not freed while still in use (no memory corruption)corruption)

Objects are freed when no longer in use (no memory leaks)Objects are freed when no longer in use (no memory leaks)

Code is easier to write because there is no question Code is easier to write because there is no question as to which component is responsible to free an as to which component is responsible to free an objectobject

When passed a buffer, who frees it: caller or callee?When passed a buffer, who frees it: caller or callee?

Each process has 1 heap used by all componentsEach process has 1 heap used by all componentsObjects can’t be allocated from different heapsObjects can’t be allocated from different heaps

You don’t have to know which heap memory was allocated You don’t have to know which heap memory was allocated in or which API to call to free the memoryin or which API to call to free the memory

In fact, there is no API to free memory, the GC does itIn fact, there is no API to free memory, the GC does it

Page 17: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

MetadataMetadata

Set of data tables embedded in an EXE/DLLSet of data tables embedded in an EXE/DLLThe tables describe what is defined in the file (Type, fields, The tables describe what is defined in the file (Type, fields, methods, etc.)methods, etc.)

Every component’s interface is described by metadata tablesEvery component’s interface is described by metadata tablesA component’s implementation is described by Intermediate A component’s implementation is described by Intermediate LanguageLanguage

The existence of metadata tables enables many featuresThe existence of metadata tables enables many featuresNo header filesNo header files

Visual Studio’s IntelliSenseVisual Studio’s IntelliSense

Components don’t have to be registered in the registryComponents don’t have to be registered in the registry

Components don’t need separate IDL or TLB filesComponents don’t need separate IDL or TLB files

The GC knows when an object’s fields refer to other objectsThe GC knows when an object’s fields refer to other objects

An object’s fields can be automatically serialized/deserializedAn object’s fields can be automatically serialized/deserialized

At runtime, an application can determine what types are in a file At runtime, an application can determine what types are in a file and what members the type defines (also known as late binding)and what members the type defines (also known as late binding)

Components can be written/used by different languagesComponents can be written/used by different languages

Page 18: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Metadata: Creation And UseMetadata: Creation And Use

MetadataMetadata(and code)(and code)

DebuggerDebugger

Schema Schema GeneratorGenerator

ProfilerProfiler

CompilersCompilers

Proxy GeneratorProxy Generator

Type BrowserType Browser

CompilerCompiler

SourceSourceCodeCode

XML encodingXML encoding(SDL or SUDS)(SDL or SUDS)

SerializationSerialization

DesignersDesigners

ReflectionReflection

TLB ExporterTLB Exporter

Page 19: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Runtime Execution ModelRuntime Execution Model

ClassClassLoaderLoader

CPUCPU

ManagedManagedNative CodeNative Code

AssemblyAssembly

First callFirst callto methodto method

First reference First reference to to typetype

AssemblyAssemblyResolverResolver

First reference First reference to Assemblyto Assembly

IL to nativeIL to nativeconversionconversion

Page 20: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

JIT Compiler - InlineJIT Compiler - Inline

Page 21: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

StandardizationStandardization

A subset of the .NET Framework and C# A subset of the .NET Framework and C# submitted to ECMAsubmitted to ECMA

ECMA and ISO International StandardsECMA and ISO International Standards

Co-sponsored with Intel, Hewlett-PackardCo-sponsored with Intel, Hewlett-Packard

Common Language InfrastructureCommon Language InfrastructureBased on Common Language Runtime and Based on Common Language Runtime and Base FrameworkBase Framework

Layered into increasing levels of Layered into increasing levels of functionalityfunctionality

Page 22: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Rotor (SSCLI) Rotor (SSCLI)

Shared-Source version of the Shared-Source version of the CLR+BCL+C# compilerCLR+BCL+C# compiler

Ports available: Windows, FreeBSD, Ports available: Windows, FreeBSD, OSX, etcOSX, etc

Real product code offers real world Real product code offers real world learning learning

http://sscli.orghttp://sscli.org

Page 23: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Developer RoadmapDeveloper Roadmap

• “ “Orcas” releaseOrcas” release

• Windows “Longhorn” Windows “Longhorn” integrationintegration

• New UI tools and New UI tools and designers designers

• Extensive managed Extensive managed interfacesinterfaces

Visual Studio Visual Studio Orcas Orcas

“Longhorn”“Longhorn”

Visual StudioVisual Studio.NET 2003.NET 2003

• “ “Everett Release”Everett Release”

• Windows Server 2003 Windows Server 2003 integrationintegration

• Support for .NET Support for .NET Compact Framework Compact Framework and device and device development development

• Improved performanceImproved performance

Visual Studio 2005 Visual Studio 2005 “Yukon”“Yukon”

• “ “Whidbey” releaseWhidbey” release

• SQL Server SQL Server integrationintegration

• Improved IDE Improved IDE productivity and productivity and community supportcommunity support

• Extended support for Extended support for XML Web servicesXML Web services

• Office Office programmabilityprogrammability

Page 24: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

AgendaAgenda

Part I - FundamentalsPart I - FundamentalsDesign Goals Design Goals

ArchitectureArchitecture

CLR ServicesCLR Services

Part II – Visual Studio 2005Part II – Visual Studio 2005Extending the PlatformExtending the Platform

Improving the PlatformImproving the Platform

Innovation in the PlatformInnovation in the Platform

Page 25: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

SQL Server IntegrationDesign GoalSQL Server IntegrationDesign Goal

Bring framework programming model Bring framework programming model into the database tierinto the database tier

Allow business logic to easily migrate Allow business logic to easily migrate to the most appropriate tierto the most appropriate tier

Enable Enable safe safe database extensionsdatabase extensions

Result: Stored Procedures, Triggers, Result: Stored Procedures, Triggers, data types defined in managed codedata types defined in managed code

Page 26: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

VS .NET VS .NET ProjectProject

Assembly: geom.dll

VB, C#, …VB, C#, … BuildBuild

SQL ServerSQL Server

SQL Data Definition: SQL Data Definition: create create assembly … assembly … create function … create function … create create procedure … procedure … create trigger … create trigger … create create type …type …SQL Queries: SQL Queries:

SELECT name FROM Supplier SELECT name FROM Supplier WHERE Location.Distance ( @point ) < 3WHERE Location.Distance ( @point ) < 3

CLR hosted by SQL (in-proc)

SQL CLR Functionality SQL CLR Functionality

Define Location.Distance()

Page 27: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Sql Programming Model Splitting a stringSql Programming Model Splitting a string

The old way…. The old way…. declare @str varchar(200)declare @str varchar(200)select @Str = 'Microsoft Corporation|SQL Server|2003|select @Str = 'Microsoft Corporation|SQL Server|2003|SQL-CLR|2002-08-20|11:32:00|Document|3.b.3'SQL-CLR|2002-08-20|11:32:00|Document|3.b.3'SELECTSELECTsubstring(@Str + '|', 0 + 1, substring(@Str + '|', 0 + 1, charindex('|', @Str + '|', 0 + 1) - 0 - 1 ),charindex('|', @Str + '|', 0 + 1) - 0 - 1 ),substring(@Str + '|', charindex('|', @Str + '|') + 1, substring(@Str + '|', charindex('|', @Str + '|') + 1, charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) - charindex('|', @Str + '|') + 1) - charindex('|', @Str + '|') - 1 ),charindex('|', @Str + '|') - 1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1,charindex('|', @Str + '|') + 1) + 1, charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|','|', charindex('|', @Str + '|') + 1) + 1) -charindex('|', @Str + '|') + 1) + 1) - charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) - 1 ),charindex('|', @Str + '|') + 1) - 1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1, charindex('|', @Str + '|') + 1) + 1) + 1, charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|','|', charindex('|', @Str + '|') + 1) + 1) + 1) -charindex('|', @Str + '|') + 1) + 1) + 1) - charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|','|', charindex('|', @Str + '|') + 1) + 1) - 1 ),charindex('|', @Str + '|') + 1) + 1) - 1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1,charindex('|', @Str + '|') + 1) + 1) + 1) + 1, charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|', '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) -charindex('|', @Str + '|') + 1) + 1) + 1) + 1) - charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|','|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) - 1 ),charindex('|', @Str + '|') + 1) + 1) + 1) - 1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|', '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1,charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1, charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|', '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|','|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) -charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) - charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|', '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) - 1 ),charindex('|', @Str + '|') + 1) + 1) + 1) + 1) - 1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|', '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1, 1, charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|', '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|','|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) - 1) - charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|', '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) - charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) - 1 ),1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) + 1,1) + 1, charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|','|', charindex('|', @Str + '|', charindex('|', @Str + charindex('|', @Str + '|', charindex('|', @Str + '|','|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) + 1) - 1) + 1) - charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) - 1 ) 1) - 1 )

declare @str varchar(200)declare @str varchar(200)select @Str = 'Microsoft Corporation|SQL Server|2003|SQL-CLR|2002-select @Str = 'Microsoft Corporation|SQL Server|2003|SQL-CLR|2002-08-20|11:32:00|Document|3.b.3'08-20|11:32:00|Document|3.b.3'SELECTSELECTsubstring(@Str + '|', 0 + 1, substring(@Str + '|', 0 + 1, charindex('|', @Str + '|', 0 + 1) - 0 - 1 ),charindex('|', @Str + '|', 0 + 1) - 0 - 1 ),substring(@Str + '|', charindex('|', @Str + '|') + 1, substring(@Str + '|', charindex('|', @Str + '|') + 1, charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) - charindex('|', @Str + '|') + 1) - charindex('|', @Str + '|') - 1 ),charindex('|', @Str + '|') - 1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1,charindex('|', @Str + '|') + 1) + 1, charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) -charindex('|', @Str + '|') + 1) + 1) - charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) - 1 ),charindex('|', @Str + '|') + 1) - 1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1, charindex('|', @Str + '|') + 1) + 1) + 1, charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) -charindex('|', @Str + '|') + 1) + 1) + 1) - charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) - 1 ),charindex('|', @Str + '|') + 1) + 1) - 1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1,charindex('|', @Str + '|') + 1) + 1) + 1) + 1, charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) -charindex('|', @Str + '|') + 1) + 1) + 1) + 1) - charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) - 1 ),charindex('|', @Str + '|') + 1) + 1) + 1) - 1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1,charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1, charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) -charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) - charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) - 1 ),charindex('|', @Str + '|') + 1) + 1) + 1) + 1) - 1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1, charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1, charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) - charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) - charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) - 1 ),charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) - 1 ),substring(@Str + '|', charindex('|', @Str + '|', substring(@Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) + 1,charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) + 1, charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) + 1) - charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) + 1) - charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|',charindex('|', @Str + '|', charindex('|', @Str + '|', charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) - 1 ) charindex('|', @Str + '|') + 1) + 1) + 1) + 1) + 1) + 1) - 1 )

Page 28: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Sql Programming Model Splitting a stringSql Programming Model Splitting a string

Public Shared Sub SplitString()Public Shared Sub SplitString() Dim s As StringDim s As String s = "Microsoft Corporation|SQL s = "Microsoft Corporation|SQL Server|Server|2003|SQL-CLR|2002-08-2003|SQL-CLR|2002-08- 20|11:32:00|20|11:32:00|Document|3.b.3"Document|3.b.3" Dim myArray() As String = Split(s, "|")Dim myArray() As String = Split(s, "|")End SubEnd Sub

The new way…. The new way….

Page 29: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Moving to 64 bitMoving to 64 bit64 bit for Servers and workstations64 bit for Servers and workstations

X64 and IA64 bit supportX64 and IA64 bit support

Enable Yukon and ASP.NETEnable Yukon and ASP.NET

Verifiable managed binaries just run!Verifiable managed binaries just run!

VS: Runs as a 32bit applicationVS: Runs as a 32bit applicationYou can develop, deploy, and debug 32 You can develop, deploy, and debug 32 and 64bit applicationsand 64bit applications

Page 30: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

AgendaAgenda

Part I - FundamentalsPart I - FundamentalsDesign Goals Design Goals

ArchitectureArchitecture

CLR ServicesCLR Services

Part II – Visual Studio 2005Part II – Visual Studio 2005Extending the PlatformExtending the Platform

Improving the PlatformImproving the Platform

Innovation in the PlatformInnovation in the Platform

Page 31: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

PerformancePerformanceObjectives: make .NET an even greater programming Objectives: make .NET an even greater programming

platformplatformLong-Term: make the performance characteristics of Long-Term: make the performance characteristics of the CLR similar to native codethe CLR similar to native code

Reduce marginal cost of additional managed processesReduce marginal cost of additional managed processes

Reduce startup time and working setReduce startup time and working set

NGenNGenCompiles IL code to native code, saving results to diskCompiles IL code to native code, saving results to disk

Advantages: no need to recompile IL to native code, Advantages: no need to recompile IL to native code, and class layout already set so better startup timeand class layout already set so better startup time

Whidbey: Significant reductions in the amount of Whidbey: Significant reductions in the amount of private, non-shareable working setprivate, non-shareable working set

OS: ‘no-Jit’ plan, all managed code will be NGenedOS: ‘no-Jit’ plan, all managed code will be NGened

Page 32: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Performance everywherePerformance everywhereNew, Performant APIsNew, Performant APIs

APIs for faster resource lookupAPIs for faster resource lookup

Lightweight CodeGen: only generates Lightweight CodeGen: only generates essential code (contrast to Reflect Emit)essential code (contrast to Reflect Emit)

Existing APIs ImprovedExisting APIs Improved

Cross AppDomain RemotingCross AppDomain RemotingBetween 1.1 and 200x faster. Biggest gains for simpler items Between 1.1 and 200x faster. Biggest gains for simpler items (strings, integers, serializable objects)(strings, integers, serializable objects)

Delegate invoke performance has more than Delegate invoke performance has more than doubleddoubled

AppDomain Footprints: significantly reducedAppDomain Footprints: significantly reduced

UTF8Encoding: translation is 2.5x fasterUTF8Encoding: translation is 2.5x faster

Page 33: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

TryParseTryParse

Page 34: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

RAD DebuggingRAD Debugging

Edit and Continue: Edit Code at runtimeEdit and Continue: Edit Code at runtimeAllowed Edits: ExamplesAllowed Edits: Examples

Add private fields to a classAdd private fields to a class

Add private non-virtual methods to a classAdd private non-virtual methods to a class

Change a function body, even while steppingChange a function body, even while stepping

Disallowed Edits: ExamplesDisallowed Edits: Examples

Removing fields/methodsRemoving fields/methods

Edits to generic classesEdits to generic classes

Serialization will not recognize new fieldsSerialization will not recognize new fields

Display Attributes for a better debugging Display Attributes for a better debugging experienceexperience

Page 35: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

CLR SecurityCLR Security

New cryptography supportNew cryptography supportPKI and PKCS7 supportPKI and PKCS7 support

XML encryption supportXML encryption support

Enhanced support for X509 certificatesEnhanced support for X509 certificates

Enhanced Application SecurityEnhanced Application SecurityPermission CalculatorPermission Calculator

Integration with ClickOnceIntegration with ClickOnce

Better SecurityExceptionBetter SecurityException

Debug-In-ZoneDebug-In-Zone

Managed ACL SupportManaged ACL Support

Page 36: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

AgendaAgenda

Part I - FundamentalsPart I - FundamentalsDesign Goals Design Goals

ArchitectureArchitecture

CLR ServicesCLR Services

Part II – Visual Studio 2005Part II – Visual Studio 2005Extending the PlatformExtending the Platform

Improving the PlatformImproving the Platform

Innovation in the PlatformInnovation in the Platform

Page 37: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

GenericsGenerics

Why generics?Why generics?Compile-time type checkingCompile-time type checking

Performance (no boxing, no downcasts)Performance (no boxing, no downcasts)

Reduced code bloat (typed collections)Reduced code bloat (typed collections)

VB, C#, MC++ produce & consume genericsVB, C#, MC++ produce & consume generics

UseUse generics freely in internal APIsgenerics freely in internal APIs

Consider using generics in public APIsConsider using generics in public APIsGenerics are not yet in CLSGenerics are not yet in CLS

To be CLS compliant, provide a non-generic API To be CLS compliant, provide a non-generic API alternativealternative

Microsoft is actively pursuing standardization of Microsoft is actively pursuing standardization of generics in runtime and languagesgenerics in runtime and languages

Page 38: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Enhancing The Base LibraryOther Generics to look out forEnhancing The Base LibraryOther Generics to look out for

Nullable(Nullable(Of TOf T))Extremely useful for situations where null is Extremely useful for situations where null is a value, such as database valuetypesa value, such as database valuetypes

EventHandlerEventHandler<T><T>Saves on making your own EventHandlersSaves on making your own EventHandlers

Dim intVal as Nullable(Dim intVal as Nullable(Of IntegerOf Integer) = 5) = 5IfIf intVal.HasValue intVal.HasValue ThenThen ‘ checks for a value ‘ checks for a value

delegate voiddelegate void EventHandlerEventHandler<T><T>((ObjectObject sender, sender, TT e) e) wherewhere T : T : EventArgsEventArgs;;

Page 39: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Whidbey Tracing FeaturesWhidbey Tracing FeaturesPluggable FormattersPluggable Formatters

Pre-WhidbeyPre-Whidbey : Formatting of Trace : Formatting of Trace information was predefined, and not information was predefined, and not controllablecontrollable

WhidbeyWhidbey : Predefined formatters : Predefined formatters (delimiter, xml) added, and you can (delimiter, xml) added, and you can make your ownmake your own

MySource;Error;13;Wrong key;;;;;;318361290184;MySource;Error;13;Wrong key;;;;;;318361290184;

Additional ListenersAdditional Listeners

Pre-WhidbeyPre-Whidbey : No Console listener, : No Console listener, ASP had their own tracing mechanismASP had their own tracing mechanism

WhidbeyWhidbey : Added Console listener. : Added Console listener. Integrated ASP tracing into our own, Integrated ASP tracing into our own, and added ETW listenerand added ETW listener

Page 40: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Whidbey Tracing FeaturesWhidbey Tracing FeaturesAuto-generated DataAuto-generated Data

Pre-WhidbeyPre-Whidbey : Standard information such as : Standard information such as timestamp or callstack would have to be timestamp or callstack would have to be explicitly generatedexplicitly generatedWhidbeyWhidbey : An Admin can easily generate this : An Admin can easily generate this data automatically, via config settingsdata automatically, via config settings<<listenerslisteners>>

<<addadd namename="examplelog" ="examplelog" typetype= …= …

Simple Thread IdentificationSimple Thread IdentificationPre-WhidbeyPre-Whidbey : specific threads were difficult : specific threads were difficult to identify, and filter onto identify, and filter onWhidbeyWhidbey : Correlation ID has been added, : Correlation ID has been added, which allows quick and easy identification of which allows quick and easy identification of a thread, and simple subsequent filteringa thread, and simple subsequent filtering

Page 41: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Whidbey Tracing FeaturesWhidbey Tracing Features

Listener FilteringListener FilteringPre-WhidbeyPre-Whidbey : Formatting of Trace : Formatting of Trace information was predefined, and not information was predefined, and not controllablecontrollableWhidbey Whidbey : Assign filtering to : Assign filtering to listeners, so only certain messages listeners, so only certain messages are traced. This allows filtering on are traced. This allows filtering on any property of a message. E.g., ID, any property of a message. E.g., ID, TimeStamp, etc.TimeStamp, etc.

SwitchesSwitchesPre-WhidbeyPre-Whidbey : Couldn’t determine : Couldn’t determine what tracing a component supportedwhat tracing a component supportedWhidbeyWhidbey : Support the ability to : Support the ability to determine what tracing mechanisms determine what tracing mechanisms a component hasa component has

Page 42: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Attend a free chat or web castAttend a free chat or web casthttp://www.microsoft.com/communities/chats/default.mspxhttp://www.microsoft.com/communities/chats/default.mspx http://www.microsoft.com/usa/webcasts/default.asphttp://www.microsoft.com/usa/webcasts/default.asp

List of newsgroupsList of newsgroupshttp://communities2.microsoft.com/http://communities2.microsoft.com/communities/newsgroups/en-us/default.aspxcommunities/newsgroups/en-us/default.aspx

MS Community SitesMS Community Siteshttp://www.microsoft.com/communities/default.mspxhttp://www.microsoft.com/communities/default.mspx

Local User GroupsLocal User Groupshttp://www.msdnbrasil.com.brhttp://www.msdnbrasil.com.br

Community sitesCommunity siteshttp://www.microsoft.com/communities/related/default.mspxhttp://www.microsoft.com/communities/related/default.mspx

Page 43: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

ResourcesResources

BCL BlogBCL Bloghttp://weblogs.asp.net/bclteamhttp://weblogs.asp.net/bclteam

BCL WebsiteBCL Websitehttp://www.gotdotnet.com/team/clr/bcl/default.aspxhttp://www.gotdotnet.com/team/clr/bcl/default.aspx

BCL public mail aliasBCL public mail [email protected]@microsoft.com

ReferenceReference.NET Framework Standard Library Annotated Reference.NET Framework Standard Library Annotated Reference

Applied Microsoft .Net Framework ProgrammingApplied Microsoft .Net Framework Programming

Page 44: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Q & A: Q & A:

Page 45: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

© 2004 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Page 46: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

BackupBackup

Page 47: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

DiagnosticsDiagnostics

Page 48: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

PerformanceCounter Integrated with PerformanceCounter Integrated with WMIWMI

EventLog Custom Message ResourcesEventLog Custom Message Resources

Structured Data Tracing Structured Data Tracing

Correlating Trace EventsCorrelating Trace Events

Tracing Integrated with ASP.NETTracing Integrated with ASP.NET

Tracing Integrated with ETWTracing Integrated with ETW

Enhancing the Base LibrarySystem.Diagnostics for Enterprise Enhancing the Base LibrarySystem.Diagnostics for Enterprise

Page 49: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Whidbey Tracing FeaturesWhidbey Tracing FeaturesPluggable FormattersPluggable Formatters

Pre-WhidbeyPre-Whidbey : Formatting of Trace : Formatting of Trace information was predefined, and not information was predefined, and not controllablecontrollable

WhidbeyWhidbey : Predefined formatters : Predefined formatters (delimiter, xml) added, and you can (delimiter, xml) added, and you can make your ownmake your own

MySource;Error;13;Wrong key;;;;;;318361290184;MySource;Error;13;Wrong key;;;;;;318361290184;

Additional ListenersAdditional Listeners

Pre-WhidbeyPre-Whidbey : No Console listener, : No Console listener, ASP had their own tracing mechanismASP had their own tracing mechanism

WhidbeyWhidbey : Added Console listener. : Added Console listener. Integrated ASP tracing into our own, Integrated ASP tracing into our own, and added ETW listenerand added ETW listener

Page 50: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Whidbey Tracing FeaturesWhidbey Tracing FeaturesAuto-generated DataAuto-generated Data

Pre-WhidbeyPre-Whidbey : Standard information such as : Standard information such as timestamp or callstack would have to be timestamp or callstack would have to be explicitly generatedexplicitly generatedWhidbeyWhidbey : An Admin can easily generate this : An Admin can easily generate this data automatically, via config settingsdata automatically, via config settings<<listenerslisteners>>

<<addadd namename="examplelog" ="examplelog" typetype= …= …

Simple Thread IdentificationSimple Thread IdentificationPre-WhidbeyPre-Whidbey : specific threads were difficult : specific threads were difficult to identify, and filter onto identify, and filter onWhidbeyWhidbey : Correlation ID has been added, : Correlation ID has been added, which allows quick and easy identification of which allows quick and easy identification of a thread, and simple subsequent filteringa thread, and simple subsequent filtering

Page 51: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Whidbey Tracing FeaturesWhidbey Tracing Features

Listener FilteringListener FilteringPre-WhidbeyPre-Whidbey : Formatting of Trace : Formatting of Trace information was predefined, and not information was predefined, and not controllablecontrollableWhidbey Whidbey : Assign filtering to : Assign filtering to listeners, so only certain messages listeners, so only certain messages are traced. This allows filtering on are traced. This allows filtering on any property of a message. E.g., ID, any property of a message. E.g., ID, TimeStamp, etc.TimeStamp, etc.

SwitchesSwitchesPre-WhidbeyPre-Whidbey : Couldn’t determine : Couldn’t determine what tracing a component supportedwhat tracing a component supportedWhidbeyWhidbey : Support the ability to : Support the ability to determine what tracing mechanisms determine what tracing mechanisms a component hasa component has

Page 52: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

JitJit

Page 53: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

JIT-CompilationJIT-Compilation

What is it?What is it?Compiles methods, on-demand, from IL to native Compiles methods, on-demand, from IL to native codecode

Native code discarded after process terminatesNative code discarded after process terminates

Disadvantages?Disadvantages?Native code not shared across AppDomains or Native code not shared across AppDomains or processesprocesses

JIT compiler uses memory: ~300 KB for its code, JIT compiler uses memory: ~300 KB for its code, plus more for its working data structuresplus more for its working data structures

Touches otherwise ‘cold’ metadata, so increasing Touches otherwise ‘cold’ metadata, so increasing memory usagememory usage

Page 54: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

NCLNCL

Page 55: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

FTP protocol supportFTP protocol support

Automatic proxy discoveryAutomatic proxy discoveryIntegrated with IEIntegrated with IE

HTTP request cachingHTTP request cachingIntegrated with the IE cacheIntegrated with the IE cache

Improved socket securityImproved socket securitySSL stream and authentication support over SSL stream and authentication support over socketssockets

Network tracingNetwork tracingEasier to debug network errorsEasier to debug network errors

Enhancing the Base LibraryImproved NetworkingEnhancing the Base LibraryImproved Networking

Page 56: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

System.UriSystem.UriPerformance enhancementsPerformance enhancements

Support for relative URI’sSupport for relative URI’s

HTTP ListenerHTTP ListenerReceive HTTP requests inside your Receive HTTP requests inside your applicationapplication

Network informationNetwork informationEnumerate cards on the machine, get Enumerate cards on the machine, get notified when things changenotified when things change

Enhancing the Base LibraryImproved NetworkingEnhancing the Base LibraryImproved Networking

Page 57: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Enhancing the Base LibraryHandling network change eventsEnhancing the Base LibraryHandling network change events

public static void AddressChanged(object source, public static void AddressChanged(object source, AddressChangedEventArgs e){AddressChangedEventArgs e){

Console.WriteLine("Address Changed"); Console.WriteLine("Address Changed"); receivedNetworkChange = true;receivedNetworkChange = true;

}}

public static void Main() {public static void Main() {NetworkInformation netInfo = new NetworkInformation();NetworkInformation netInfo = new NetworkInformation();

netInfo.AddressChanged += new netInfo.AddressChanged += new NetworkInformation.AddressChangedEventHandler(Class1.AddressChanged)NetworkInformation.AddressChangedEventHandler(Class1.AddressChanged);;

netInfo.StartListeningForAddressChanges();netInfo.StartListeningForAddressChanges();

while(true){while(true){ if (receivedNetworkChange) if (receivedNetworkChange) netInfo.StopListeningForAddressChanges();netInfo.StopListeningForAddressChanges();

}}}}

Page 58: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Enhancing the Base LibraryFTP Protocol SupportEnhancing the Base LibraryFTP Protocol Support

Sub DownloadFile()Sub DownloadFile() Dim filename As StringDim filename As String filename = "ftp://ms.com/files/dotnetfx.exe"filename = "ftp://ms.com/files/dotnetfx.exe" Dim client As New WebClientDim client As New WebClient client.DownloadFile(filename, "dotnextfx.exe")client.DownloadFile(filename, "dotnextfx.exe")End SubEnd Sub

Page 59: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Automatic proxy discoveryAutomatic proxy discoveryIntegrated with IEIntegrated with IE

HTTP ListenerHTTP ListenerReceive HTTP requests inside your applicationReceive HTTP requests inside your application

HTTP request cachingHTTP request cachingIntegrated with the IE cacheIntegrated with the IE cache

Improved socket securityImproved socket securitySSL stream and authentication support over SSL stream and authentication support over socketssockets

Network tracingNetwork tracingEasier to debug network errorsEasier to debug network errors

Enhancing the Base LibraryImproved NetworkingEnhancing the Base LibraryImproved Networking

Page 60: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Enhancing the Base LibraryCheck network availability Enhancing the Base LibraryCheck network availability

Dim netInfo as new NetworkInformation()Dim netInfo as new NetworkInformation()If (netInfo.GetIsConnected() = True) If (netInfo.GetIsConnected() = True) 'use network resources'use network resourcesElse Else    'use local cache'use local cacheEnd IfEnd If

Page 61: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

StandardizationStandardization

Page 62: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

StandardizationStandardizationStandard for CLI and C#Standard for CLI and C#

ECMA approved December 2001ECMA approved December 2001ISO expected October 2002ISO expected October 2002

Several CLI implementationsSeveral CLI implementations.NET Framework.NET Framework.NET Compact Framework.NET Compact FrameworkSSCLI (“Rotor”) – Shared source on XP, SSCLI (“Rotor”) – Shared source on XP, FreeBSD, OS XFreeBSD, OS X““Mono” – Open source on LinuxMono” – Open source on Linux

Whidbey maintains a high level of Whidbey maintains a high level of compliance compliance Active engagement continuesActive engagement continues

Generics, parallel processing extensions, etcGenerics, parallel processing extensions, etc

Page 63: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Reliability – Managed CodeReliability – Managed Code

‘‘SafeHandle’SafeHandle’Can clean up unmanaged resources in Can clean up unmanaged resources in exceptional conditionsexceptional conditions

HostProtectionAttributeHostProtectionAttributeAllow hosts to decide what features to Allow hosts to decide what features to supportsupport

Reliable Managed Code GuidanceReliable Managed Code GuidanceUpcoming whitepaper & samplesUpcoming whitepaper & samples

Page 64: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

ThreadingThreading

Page 65: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

ThreadingSemaphoreThreadingSemaphore

Resource counting for mutex’sResource counting for mutex’s// construct a semaphore with a count of 3// construct a semaphore with a count of 3

Semaphore sem = new Semaphore(3);Semaphore sem = new Semaphore(3);

private void UseResource {private void UseResource {

// Wait until a count is available…// Wait until a count is available…

sem.WaitOne(); sem.WaitOne(); // // the sem count is reduced by one the sem count is reduced by one

// other code …// other code …

// Release the count:// Release the count:

sem.Release(); sem.Release(); // // the count is incremented by one the count is incremented by one

Page 66: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

ThreadingNamed EventsThreadingNamed Events

V1.0 and V1.1: Events can only signal V1.0 and V1.1: Events can only signal the same processthe same process

Whidbey: Named Events allow cross Whidbey: Named Events allow cross process communicationprocess communication

V1.0 and V1.1: Events can only signal V1.0 and V1.1: Events can only signal the same processthe same process

Whidbey: Named Events allow cross Whidbey: Named Events allow cross process communicationprocess communication

Public Class EventWaitHandle Inherits WaitHandle Public Sub New EventWaitHandle(initialState As

Boolean, type As EventType, name As String )

Page 67: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

BackupBackup

Page 68: .Net Framework Joel Pereira (joelcdp@microsoft.com) Software Design Engineer WinFS API Team Microsoft Corporation.

Tools

Client Application Model

Avalon Windows Forms

Web & Service Application Model

ASP.NET / Indigo Win FSCompact

FrameworkYukon Mobile PC Optimized

System.HelpSystem.Help

System.DrawingSystem.Drawing

System.NaturalLanguageServicesSystem.NaturalLanguageServices

Data Systems Application Model

Presentation Data

Mobile PC & Devices Application Model

Communication

Command Line

NT Service

DataSetDataSet

MappingMapping

ObjectSpacesObjectSpaces

ObjectSpaceObjectSpace

QueryQuery

SchemaSchema

ItemItem

RelationshipRelationship

MediaMedia

AudioAudio

VideoVideo

ImagesImages

System.MessagingSystem.Messaging System.DiscoverySystem.Discovery

System.DirectoryServicesSystem.DirectoryServices

System.RemotingSystem.Remoting

System.Runtime.RemotingSystem.Runtime.Remoting

ActiveDirectoryActiveDirectory

UddiUddi

System.Web.ServicesSystem.Web.Services

Web.ServiceWeb.Service

DescriptionDescription

DiscoveryDiscovery

ProtocolsProtocols

System.MessageBusSystem.MessageBus

TransportTransport

PortPort

ChannelChannel

ServiceService

QueueQueue

PubSubPubSub

RouterRouter

System.SerializationSystem.Serialization

System.ThreadingSystem.Threading

System.TextSystem.Text

System.DesignSystem.Design

Base & Application Services

Fundamentals

System.ComponentModelSystem.ComponentModel

System.CodeDomSystem.CodeDom

System.ReflectionSystem.Reflection

System.EnterpriseServicesSystem.EnterpriseServices

System.TransactionsSystem.Transactions

Security

System.Windows.TrustManagementSystem.Windows.TrustManagement

System.Web.SecuritySystem.Web.Security

System.MessageBus.SecuritySystem.MessageBus.Security

AuthorizationAuthorization

AccessControlAccessControl

CredentialsCredentials

CryptographyCryptography

System.Web.ConfigurationSystem.Web.Configuration

System.MessageBus.ConfigurationSystem.MessageBus.Configuration

System.ConfigurationSystem.Configuration

System.ResourcesSystem.ResourcesSystem.ManagementSystem.Management

System.DeploymentSystem.Deployment

System.DiagnosticsSystem.Diagnostics

Configuration Deployment/Management

System.WindowsSystem.Windows System.WindowsSystem.WindowsSystem.Windows.FormsSystem.Windows.Forms

System.ConsoleSystem.Console

System.ServiceProcessSystem.ServiceProcess

System.Windows.FormsSystem.Windows.Forms System.WebSystem.Web System.StorageSystem.Storage System.Data.SqlServ

erSystem.Data.SqlServer

AnimationAnimation

ControlsControls

ControlControl

DesignDesign

PanelPanel

ControlsControls

DialogsDialogs

SideBarSideBar

NotificationNotification

System.WindowsSystem.Windows

DocumentsDocuments

Text ElementText Element

ShapesShapes

ShapeShape

InkInk

UI ElementUI Element ExplorerExplorer MediaMedia

System.Windows.FormsSystem.Windows.Forms

FormsForms

ControlControl

Print DialogPrint Dialog

DesignDesign

System.Web.UISystem.Web.UI

PagePage

ControlControl

HtmlControlsHtmlControls

MobileControlsMobileControls

WebControlsWebControls

AdaptorsAdaptors

DesignDesign

PortsPorts

InteropServicesInteropServices

System.RuntimeSystem.Runtime

System.IOSystem.IO

System.CollectionsSystem.Collections

GenericGeneric

System.SearchSystem.Search

AnnotationsAnnotations

MonitoringMonitoring

LoggingLogging

RelevanceRelevance

System.DataSystem.Data

SqlClientSqlClient

SqlTypesSqlTypes

SqlXMLSqlXML

OdbcClientOdbcClient

OleDbClientOleDbClient

OracleClientOracleClient

CoreCore

ContactContact

LocationLocation

MessageMessage

DocumentDocument

EventEvent

System.StorageSystem.Storage

System.WebSystem.Web

PersonalizationPersonalization

CachingCaching

SessionStateSessionState

System.XmlSystem.Xml

SchemaSchema

SerializationSerialization

XpathXpath

QueryQuery

PermissionsPermissions

PolicyPolicy

PrincipalPrincipal

TokenToken

System.SecuritySystem.Security

System.CollaborationSystem.Collaboration

RealTimeEndpointRealTimeEndpoint

TransientDataSessionTransientDataSession

SignalingSessionSignalingSession

MediaMedia

ActivitiesActivities

HttpWebRequestHttpWebRequest

FtpWebListenerFtpWebListener

SslClientStreamSslClientStream

WebClientWebClient

System.NetSystem.Net

NetworkInformationNetworkInformation

SocketsSockets

CacheCache

System.WebSystem.Web

AdministrationAdministration

ManagementManagement

NavigationNavigation

Peer GroupPeer Group

PolicyPolicy

SerializationSerialization

CompilerServicesCompilerServices

RecognitionRecognition

System.SpeechSystem.Speech

SynthesisSynthesis

SystemSystem

System.GlobalizationSystem.Globalization

Namespaces