Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

53
Neno Loje Microsoft Student Partner Universität Hamburg Microsoft .NET Framework 2.0

Transcript of Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Page 1: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Neno LojeMicrosoft Student Partner

Universität Hamburg

Microsoft .NET Framework 2.0

Page 2: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Was ist „Whidbey“?

Code Name für• … die nächste Version vom .NET Framework• … die nächste Version von C#, Visual

Basic .NET• … die nächste Version von Visual Studio

Voraussichtliche Produktnamen• … .NET Framework 2.0• … Visual Studio 2005

Page 3: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Agenda

Was ist neu in… ?

• … .NET Framework (BCL)• … Spracherweiterungen / CTS• … Windows Forms 2.0• … ASP.NET 2.0• … ADO.NET 2.0• … Visual Studio 2005• … Noch einiges mehr

Page 4: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Drucken ist erheblich einfacher

Private Sub Button1_Click(…) Handles Button1.ClickWith My.Computer.Printer.WriteLine("Circuit Board ID: " & _ txtCircuitBoardID.Text).WriteLine("Date Printed: " & Now).WriteLine(PictureBox1.Image) .WriteHorizontalLine(Height:=3).WriteLine("Test Data").WriteLine(TextBox1.Text).Print(PreviewDialog:=True)End WithEnd Sub

Private Sub Button1_Click(…) Handles Button1.ClickWith My.Computer.Printer.WriteLine("Circuit Board ID: " & _ txtCircuitBoardID.Text).WriteLine("Date Printed: " & Now).WriteLine(PictureBox1.Image) .WriteHorizontalLine(Height:=3).WriteLine("Test Data").WriteLine(TextBox1.Text).Print(PreviewDialog:=True)End WithEnd Sub

Private Sub Button1_Click(…) Handles Button1.Click PrintPreviewDialog1.Document = PrintDocument1 PrintPreviewDialog1.ShowDialog()End SubPrivate Sub PrintDocument1_PrintPage(…) Handles PrintDocument1.PrintPage Dim font As New Font("Arial", 10) Dim brush As Brush = Brushes.Black Dim X As Integer = 50 Dim Y As Integer = 50 Dim LineHeight As Integer = 20 With e.Graphics .DrawString("Circuit Board ID: " & _ txtCircuitBoardID.Text, font, _ brush, X, Y) Y = Y + LineHeight .DrawString("Date Printed: " & Now, font, _ brush, X, Y) Y = Y + LineHeight .DrawImage(PictureBox1.Image, X, Y) Y = Y + LineHeight + _ PictureBox1.Image.Height .DrawLine(Pens.Black, X, Y, 750, Y) Y = Y + LineHeight .DrawString("Test Data", font, brush, X, Y) Y = Y + LineHeight .DrawString(TextBox1.Text, font, brush, X, Y) End WithEnd Sub

Private Sub Button1_Click(…) Handles Button1.Click PrintPreviewDialog1.Document = PrintDocument1 PrintPreviewDialog1.ShowDialog()End SubPrivate Sub PrintDocument1_PrintPage(…) Handles PrintDocument1.PrintPage Dim font As New Font("Arial", 10) Dim brush As Brush = Brushes.Black Dim X As Integer = 50 Dim Y As Integer = 50 Dim LineHeight As Integer = 20 With e.Graphics .DrawString("Circuit Board ID: " & _ txtCircuitBoardID.Text, font, _ brush, X, Y) Y = Y + LineHeight .DrawString("Date Printed: " & Now, font, _ brush, X, Y) Y = Y + LineHeight .DrawImage(PictureBox1.Image, X, Y) Y = Y + LineHeight + _ PictureBox1.Image.Height .DrawLine(Pens.Black, X, Y, 750, Y) Y = Y + LineHeight .DrawString("Test Data", font, brush, X, Y) Y = Y + LineHeight .DrawString(TextBox1.Text, font, brush, X, Y) End WithEnd Sub

Visual Basic .NET 2003

Visual Basic “Whidbey”

Page 5: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

The .NET FrameworkA Once in a Decade Change

• PDC 2000 Paradigm Shift– Web services– Managed Code

19801980 19901990 20002000

Ric

hn

ess

Ric

hn

ess

Win16Win16 Win32Win32COMCOM

MFCMFCComponents

ComponentsServicesServices

APIsAPIs

Windows3.0

Page 6: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Landmarks To Date

• Running in over 60% of Fortune 100

• More than 70M systems with .NET Framework

• Strong developer ecosystem

• ISO standardization

0%

50%

100%

150%

200%

250%

300%

350%

Q202 to Q302 Q302 to Q402 Q402 to Q103 Q103 to Q203

Growth of ASP.NET (Netcraft)

Page 7: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Tools

Client Application Model

Windows Forms

Web & Service Application Model

ASP.NET Compact Framewo

rk

Yukon

Data Systems Application Model

Presentation

Mobile PC & Devices Application Model

Communication

Command Line

NT Service

System.MessagingSystem.MessagingSystem.DirectoryServicesSystem.DirectoryServicesSystem.Runtime.RemotingSystem.Runtime.Remoting

System.Windows.FormsSystem.Windows.Forms

System.ConsoleSystem.Console

System.ServiceProcessSystem.ServiceProcess

System.Windows.FormsSystem.Windows.Forms System.WebSystem.Web System.Data.SqlSe

rverSystem.Data.SqlServer

HttpWebRequestHttpWebRequestFtpWebListenerFtpWebListener

SslClientStreamSslClientStream

WebClientWebClient

System.NetSystem.Net

NetworkInformationNetworkInformation

SocketsSockets

CacheCache

System.Windows.FormsSystem.Windows.Forms

FormsForms

ControlControl

Print DialogPrint Dialog

DesignDesign

System.Web.UISystem.Web.UI

PagePage

ControlControl

HtmlControlsHtmlControls

MobileControlsMobileControls

WebControlsWebControls

AdaptorsAdaptors

DesignDesign

System.DrawingSystem.Drawing

System.Web.ServicesSystem.Web.Services

Web.ServiceWeb.Service

DescriptionDescription

DiscoveryDiscovery

ProtocolsProtocols

System.TimersSystem.Timers

System.GlobalizationSystem.Globalization

System.SerializationSystem.Serialization

System.ThreadingSystem.Threading

System.TextSystem.Text

System.DesignSystem.Design

SerializationSerialization

CompilerServicesCompilerServices

Base & Application Services

Fundamentals

System.ComponentModelSystem.ComponentModel

System.CodeDomSystem.CodeDom

System.ReflectionSystem.Reflection

System.EnterpriseServicesSystem.EnterpriseServices

System.TransactionsSystem.Transactions

Security

System.Web.SecuritySystem.Web.Security

AccessControlAccessControl

CredentialsCredentials

CryptographyCryptography

System.Web.ConfigurationSystem.Web.Configuration

System.ConfigurationSystem.Configuration

System.ResourcesSystem.Resources

System.ManagementSystem.Management

System.DeploymentSystem.Deployment

System.DiagnosticsSystem.Diagnostics

Configuration Deployment/Management

PortsPorts

InteropServicesInteropServices

System.RuntimeSystem.Runtime

System.IOSystem.IO

System.CollectionsSystem.Collections

GenericGeneric

PermissionsPermissions

PolicyPolicy

PrincipalPrincipal

TokenToken

System.SecuritySystem.Security System.WebSystem.Web

AdministrationAdministration

ManagementManagement

.NET Framework “Whidbey”

Data

System.WebSystem.Web

PersonalizationPersonalization

CachingCaching

SessionStateSessionState

System.XmlSystem.Xml

SchemaSchema

SerializationSerialization

XpathXpath

QueryQuery

DataSetDataSet

MappingMapping

ObjectSpacesObjectSpaces

ObjectSpaceObjectSpace

QueryQuery

SchemaSchema

System.DataSystem.Data

SqlClientSqlClient

SqlTypesSqlTypes

SqlXMLSqlXML

OdbcClientOdbcClient

OleDbClientOleDbClient

OracleClientOracleClient

Page 8: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Base Innovations

• 64-bit Support• Performance• Edit and Continue• Base Library

Enhancements• Generics

42

Tools

Client Application Model

Windows Forms

Web & Service Application Model

ASP.NET Compact

FrameworkYukon

Data Systems Application Model

Presentation

Mobile PC & Devices Application Model

Communication

Command Line

NTService

System.MessagingSystem.Messaging

System.DirectoryServicesSystem.DirectoryServices

System.Runtime.RemotingSystem.Runtime.Remoting

System.Windows.FormsSystem.Windows.Forms

System.ConsoleSystem.Console

System.ServiceProcessSystem.ServiceProcess

System.Windows.FormsSystem.Windows.Forms System.WebSystem.Web System.Data.SqlServerSystem.Data.SqlServer

HttpWebRequestHttpWebRequest

FtpWebListenerFtpWebListener

SslClientStreamSslClientStream

WebClientWebClient

System.NetSystem.Net

NetworkInformationNetworkInformation

SocketsSockets

CacheCache

System.Windows.FormsSystem.Windows.Forms

FormsForms

ControlControl

Print DialogPrint Dialog

DesignDesign

System.Web.UISystem.Web.UI

PagePage

ControlControl

HtmlControlsHtmlControls

MobileControlsMobileControls

WebControlsWebControls

AdaptorsAdaptors

DesignDesign

System.DrawingSystem.Drawing

System.Web.ServicesSystem.Web.Services

Web.ServiceWeb.Service

DescriptionDescription

DiscoveryDiscovery

ProtocolsProtocols

System.TimersSystem.Timers

System.GlobalizationSystem.Globalization

System.SerializationSystem.Serialization

System.ThreadingSystem.Threading

System.TextSystem.Text

System.DesignSystem.Design

SerializationSerialization

CompilerServicesCompilerServices

Base & Application Services

Fundamentals

System.ComponentModelSystem.ComponentModel

System.CodeDomSystem.CodeDom

System.ReflectionSystem.Reflection

System.EnterpriseServicesSystem.EnterpriseServices

System.TransactionsSystem.Transactions

Security

System.Web.SecuritySystem.Web.Security

AccessControlAccessControl

CredentialsCredentials

CryptographyCryptography

System.Web.ConfigurationSystem.Web.Configuration

System.ConfigurationSystem.Configuration

System.ResourcesSystem.Resources

System.ManagementSystem.Management

System.DeploymentSystem.Deployment

System.DiagnosticsSystem.Diagnostics

Configuration Deployment/Management

PortsPorts

InteropServicesInteropServices

System.RuntimeSystem.Runtime

System.IOSystem.IO

System.CollectionsSystem.Collections

GenericGenericPermissionsPermissions

PolicyPolicy

PrincipalPrincipal

TokenToken

System.SecuritySystem.Security System.WebSystem.Web

AdministrationAdministration

ManagementManagement

.NET Framework “Whidbey”

Data

System.WebSystem.Web

PersonalizationPersonalization

CachingCaching

SessionStateSessionState

System.XmlSystem.Xml

SchemaSchema

SerializationSerialization

XpathXpath

QueryQuery

DataSetDataSet

MappingMapping

ObjectSpacesObjectSpaces

ObjectSpaceObjectSpace

QueryQuery

SchemaSchema

System.DataSystem.Data

SqlClientSqlClient

SqlTypesSqlTypes

SqlXMLSqlXML

OdbcClientOdbcClient

OleDbClientOleDbClient

OracleClientOracleClient

Page 9: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Innovations In Data Access

• ADO.NET– No Model Changes– Advanced Features– Performance

• System.Xml– Performance– XQuery

• ObjectSpaces– Builds on ADO.NET– Domain objects: Customer,

Order, Address

Tools

Client Application Model

Windows Forms

Web & Service Application Model

ASP.NET Compact

FrameworkYukon

Data Systems Application Model

Presentation

Mobile PC & Devices Application Model

Communication

Command Line

NTService

System.MessagingSystem.Messaging

System.DirectoryServicesSystem.DirectoryServices

System.Runtime.RemotingSystem.Runtime.Remoting

System.Windows.FormsSystem.Windows.Forms

System.ConsoleSystem.Console

System.ServiceProcessSystem.ServiceProcess

System.Windows.FormsSystem.Windows.Forms System.WebSystem.Web System.Data.SqlServerSystem.Data.SqlServer

HttpWebRequestHttpWebRequest

FtpWebListenerFtpWebListener

SslClientStreamSslClientStream

WebClientWebClient

System.NetSystem.Net

NetworkInformationNetworkInformation

SocketsSockets

CacheCache

System.Windows.FormsSystem.Windows.Forms

FormsForms

ControlControl

Print DialogPrint Dialog

DesignDesign

System.Web.UISystem.Web.UI

PagePage

ControlControl

HtmlControlsHtmlControls

MobileControlsMobileControls

WebControlsWebControls

AdaptorsAdaptors

DesignDesign

System.DrawingSystem.Drawing

System.Web.ServicesSystem.Web.Services

Web.ServiceWeb.Service

DescriptionDescription

DiscoveryDiscovery

ProtocolsProtocols

System.TimersSystem.Timers

System.GlobalizationSystem.Globalization

System.SerializationSystem.Serialization

System.ThreadingSystem.Threading

System.TextSystem.Text

System.DesignSystem.Design

SerializationSerialization

CompilerServicesCompilerServices

Base & Application Services

Fundamentals

System.ComponentModelSystem.ComponentModel

System.CodeDomSystem.CodeDom

System.ReflectionSystem.Reflection

System.EnterpriseServicesSystem.EnterpriseServices

System.TransactionsSystem.Transactions

Security

System.Web.SecuritySystem.Web.Security

AccessControlAccessControl

CredentialsCredentials

CryptographyCryptography

System.Web.ConfigurationSystem.Web.Configuration

System.ConfigurationSystem.Configuration

System.ResourcesSystem.Resources

System.ManagementSystem.Management

System.DeploymentSystem.Deployment

System.DiagnosticsSystem.Diagnostics

Configuration Deployment/Management

PortsPorts

InteropServicesInteropServices

System.RuntimeSystem.Runtime

System.IOSystem.IO

System.CollectionsSystem.Collections

GenericGenericPermissionsPermissions

PolicyPolicy

PrincipalPrincipal

TokenToken

System.SecuritySystem.Security System.WebSystem.Web

AdministrationAdministration

ManagementManagement

.NET Framework “Whidbey” - Data

Data

System.XmlSystem.Xml

SchemaSchema

SerializationSerialization

XpathXpath

QueryQuery

DataSetDataSet

MappingMapping

ObjectSpacesObjectSpaces

ObjectSpaceObjectSpace

QueryQuery

SchemaSchema

System.DataSystem.Data

SqlClientSqlClient

SqlTypesSqlTypes

SqlXMLSqlXML

OdbcClientOdbcClient

OleDbClientOleDbClient

OracleClientOracleClient

Page 10: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Innovations In Data Access:SQL Server “Yukon”

• Extend SQL’s type system, stored procs, functions, triggers in managed code

• Leverage broad developer ecosystem

• Wide choice of languages – Visual Basic, C#, MC++,

COBOL, …and T-SQL

• Leverages much of the .NET Framework – BCL, network access,

Web services…

• Enable third parties to write libraries to extend the DB

Tools

Client Application Model

Windows Forms

Web & Service Application Model

ASP.NET Compact

Framework

Presentation

Mobile PC & Devices Application Model

Communication

Command Line

NTService

System.MessagingSystem.Messaging

System.DirectoryServicesSystem.DirectoryServices

System.Runtime.RemotingSystem.Runtime.Remoting

System.Windows.FormsSystem.Windows.Forms

System.ConsoleSystem.Console

System.ServiceProcessSystem.ServiceProcess

System.Windows.FormsSystem.Windows.Forms System.WebSystem.Web

HttpWebRequestHttpWebRequest

FtpWebListenerFtpWebListener

SslClientStreamSslClientStream

WebClientWebClient

System.NetSystem.Net

NetworkInformationNetworkInformation

SocketsSockets

CacheCache

System.Windows.FormsSystem.Windows.Forms

FormsForms

ControlControl

Print DialogPrint Dialog

DesignDesign

System.Web.UISystem.Web.UI

PagePage

ControlControl

HtmlControlsHtmlControls

MobileControlsMobileControls

WebControlsWebControls

AdaptorsAdaptors

DesignDesign

System.DrawingSystem.Drawing

System.Web.ServicesSystem.Web.Services

Web.ServiceWeb.Service

DescriptionDescription

DiscoveryDiscovery

ProtocolsProtocols

System.TimersSystem.Timers

System.GlobalizationSystem.Globalization

System.SerializationSystem.Serialization

System.ThreadingSystem.Threading

System.TextSystem.Text

System.DesignSystem.Design

SerializationSerialization

CompilerServicesCompilerServices

Base & Application Services

Fundamentals

System.ComponentModelSystem.ComponentModel

System.CodeDomSystem.CodeDom

System.ReflectionSystem.Reflection

System.EnterpriseServicesSystem.EnterpriseServices

System.TransactionsSystem.Transactions

Security

System.Web.SecuritySystem.Web.Security

AccessControlAccessControl

CredentialsCredentials

CryptographyCryptography

System.Web.ConfigurationSystem.Web.Configuration

System.ConfigurationSystem.Configuration

System.ResourcesSystem.Resources

System.ManagementSystem.Management

System.DeploymentSystem.Deployment

System.DiagnosticsSystem.Diagnostics

Configuration Deployment/Management

PortsPorts

InteropServicesInteropServices

System.RuntimeSystem.Runtime

System.IOSystem.IO

System.CollectionsSystem.Collections

GenericGenericPermissionsPermissions

PolicyPolicy

PrincipalPrincipal

TokenToken

System.SecuritySystem.Security System.WebSystem.Web

AdministrationAdministration

ManagementManagement

.NET Framework “Whidbey”- Yukon

Data

System.WebSystem.Web

PersonalizationPersonalization

CachingCaching

SessionStateSessionState

System.XmlSystem.Xml

SchemaSchema

SerializationSerialization

XpathXpath

QueryQuery

DataSetDataSet

MappingMapping

ObjectSpacesObjectSpaces

ObjectSpaceObjectSpace

QueryQuery

SchemaSchema

System.DataSystem.Data

SqlClientSqlClient

SqlTypesSqlTypes

SqlXMLSqlXML

OdbcClientOdbcClient

OleDbClientOleDbClient

OracleClientOracleClient

Yukon

Data Systems Application Model

System.Data.SqlServerSystem.Data.SqlServer

Page 11: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Innovations On The WebASP.NET Whidbey

• Reduce plumbing code by 70%

• Building Blocks• Page Framework• 40+ New ASP.NET

controls

Tools

Client Application Model

Windows Forms

Web & Service Application Model

Compact FrameworkYukon

Data Systems Application Model

Presentation

Mobile PC & Devices Application Model

Communication

Command Line

NTService

System.MessagingSystem.Messaging

System.DirectoryServicesSystem.DirectoryServices

System.Runtime.RemotingSystem.Runtime.Remoting

System.Windows.FormsSystem.Windows.Forms

System.ConsoleSystem.Console

System.ServiceProcessSystem.ServiceProcess

System.Windows.FormsSystem.Windows.Forms System.Data.SqlServerSystem.Data.SqlServer

HttpWebRequestHttpWebRequest

FtpWebListenerFtpWebListener

SslClientStreamSslClientStream

WebClientWebClient

System.NetSystem.Net

NetworkInformationNetworkInformation

SocketsSockets

CacheCache

System.Windows.FormsSystem.Windows.Forms

FormsForms

ControlControl

Print DialogPrint Dialog

DesignDesign

System.Web.UISystem.Web.UI

PagePage

ControlControl

HtmlControlsHtmlControls

MobileControlsMobileControls

WebControlsWebControls

AdaptorsAdaptors

DesignDesign

System.DrawingSystem.Drawing

System.Web.ServicesSystem.Web.Services

Web.ServiceWeb.Service

DescriptionDescription

DiscoveryDiscovery

ProtocolsProtocols

System.TimersSystem.Timers

System.GlobalizationSystem.Globalization

System.SerializationSystem.Serialization

System.ThreadingSystem.Threading

System.TextSystem.Text

System.DesignSystem.Design

SerializationSerialization

CompilerServicesCompilerServices

Base & Application Services

Fundamentals

System.ComponentModelSystem.ComponentModel

System.CodeDomSystem.CodeDom

System.ReflectionSystem.Reflection

System.EnterpriseServicesSystem.EnterpriseServices

System.TransactionsSystem.Transactions

Security

System.Web.SecuritySystem.Web.Security

AccessControlAccessControl

CredentialsCredentials

CryptographyCryptography

System.Web.ConfigurationSystem.Web.Configuration

System.ConfigurationSystem.Configuration

System.ResourcesSystem.Resources

System.ManagementSystem.Management

System.DeploymentSystem.Deployment

System.DiagnosticsSystem.Diagnostics

Configuration Deployment/Management

PortsPorts

InteropServicesInteropServices

System.RuntimeSystem.Runtime

System.IOSystem.IO

System.CollectionsSystem.Collections

GenericGenericPermissionsPermissions

PolicyPolicy

PrincipalPrincipal

TokenToken

System.SecuritySystem.Security System.WebSystem.Web

AdministrationAdministration

ManagementManagement

.NET Framework “Whidbey” – ASP.NET

Data

System.WebSystem.Web

PersonalizationPersonalization

CachingCaching

SessionStateSessionState

System.XmlSystem.Xml

SchemaSchema

SerializationSerialization

XpathXpath

QueryQuery

DataSetDataSet

MappingMapping

ObjectSpacesObjectSpaces

ObjectSpaceObjectSpace

QueryQuery

SchemaSchema

System.DataSystem.Data

SqlClientSqlClient

SqlTypesSqlTypes

SqlXMLSqlXML

OdbcClientOdbcClient

OleDbClientOleDbClient

OracleClientOracleClient

ASP.NET

System.WebSystem.Web

Page 12: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.
Page 13: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Innovations For Devices

• Mobile capabilities for all ASP.NET controls

• Tablet PC SDK extends the core Framework

• Improvements in .NET Compact Framework security, performance and interoperability

Tools

Client Application Model

Windows Forms

Web & Service Application Model

ASP.NET Yukon

Data Systems Application Model

Presentation

Mobile PC & Devices Application Model

Communication

Command Line

NTService

System.MessagingSystem.Messaging

System.DirectoryServicesSystem.DirectoryServices

System.Runtime.RemotingSystem.Runtime.Remoting

System.ConsoleSystem.Console

System.ServiceProcessSystem.ServiceProcess

System.Windows.FormsSystem.Windows.Forms System.WebSystem.Web System.Data.SqlServerSystem.Data.SqlServer

HttpWebRequestHttpWebRequest

FtpWebListenerFtpWebListener

SslClientStreamSslClientStream

WebClientWebClient

System.NetSystem.Net

NetworkInformationNetworkInformation

SocketsSockets

CacheCache

System.Windows.FormsSystem.Windows.Forms

FormsForms

ControlControl

Print DialogPrint Dialog

DesignDesign

System.Web.UISystem.Web.UI

PagePage

ControlControl

HtmlControlsHtmlControls

MobileControlsMobileControls

WebControlsWebControls

AdaptorsAdaptors

DesignDesign

System.DrawingSystem.Drawing

System.Web.ServicesSystem.Web.Services

Web.ServiceWeb.Service

DescriptionDescription

DiscoveryDiscovery

ProtocolsProtocols

System.TimersSystem.Timers

System.GlobalizationSystem.Globalization

System.SerializationSystem.Serialization

System.ThreadingSystem.Threading

System.TextSystem.Text

System.DesignSystem.Design

SerializationSerialization

CompilerServicesCompilerServices

Base & Application Services

Fundamentals

System.ComponentModelSystem.ComponentModel

System.CodeDomSystem.CodeDom

System.ReflectionSystem.Reflection

System.EnterpriseServicesSystem.EnterpriseServices

System.TransactionsSystem.Transactions

Security

System.Web.SecuritySystem.Web.Security

AccessControlAccessControl

CredentialsCredentials

CryptographyCryptography

System.Web.ConfigurationSystem.Web.Configuration

System.ConfigurationSystem.Configuration

System.ResourcesSystem.Resources

System.ManagementSystem.Management

System.DeploymentSystem.Deployment

System.DiagnosticsSystem.Diagnostics

Configuration Deployment/Management

PortsPorts

InteropServicesInteropServices

System.RuntimeSystem.Runtime

System.IOSystem.IO

System.CollectionsSystem.Collections

GenericGenericPermissionsPermissions

PolicyPolicy

PrincipalPrincipal

TokenToken

System.SecuritySystem.Security System.WebSystem.Web

AdministrationAdministration

ManagementManagement

.NET Framework “Whidbey” - Devices

Data

System.WebSystem.Web

PersonalizationPersonalization

CachingCaching

SessionStateSessionState

System.XmlSystem.Xml

SchemaSchema

SerializationSerialization

XpathXpath

QueryQuery

DataSetDataSet

MappingMapping

ObjectSpacesObjectSpaces

ObjectSpaceObjectSpace

QueryQuery

SchemaSchema

System.DataSystem.Data

SqlClientSqlClient

SqlTypesSqlTypes

SqlXMLSqlXML

OdbcClientOdbcClient

OleDbClientOleDbClient

OracleClientOracleClient

Compact Framework

System.Windows.FormsSystem.Windows.Forms

Page 14: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Road To Longhorn• All building on the .NET Framework

– Delivering amazing new user experiences with Avalon – Extending Web services to the client with Indigo– Everyday info with WinFS

Ric

hn

ess

Ric

hn

ess

Win16Win16 Win32Win32COMCOM

MFCMFC

Components

ComponentsServicesServices

APIsAPIsWindows

3.0

WinFXWinFX

.NET Framework “Whidbey”

Page 15: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Related Longhorn Era Technologies

• Windows Forms– Works great on Longhorn!– Two-way interop with Avalon– See: CLI391 Windows Forms: Exploiting Windows “Longhorn”

Features from Within Your Application 

• ASMX, .NET Remoting and Enterprise Services– All work great on Longhorn!– Indigo unifies RPC style programming – See: WSV203  “Indigo”: Connected Application Technology

Roadmap

Page 16: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Summary

• Whidbey Design Goals– Deliver on the Fundamentals: Security, Deployment,

Manageability, Performance– Enhanced Productivity– Path to the Future WinFX

Page 17: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

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

Page 18: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Talk Focus

• This talk is focused on– Features which enable you to be more productive

(write your code more quickly)

– Features which allow you to write faster, or more resource aware code

– Features which YOU asked for!• (more managed solutions)

Page 19: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

AgendaTopic Breakdown

ProductivityEase-Of-Use

Faster, Resource Aware

IO

New Managed Solutions

FriendAssemblies

Strongly TypedResources

RAD Debugging

Generics

TryParse

Memory Pressure

EventLog

Environment

Tracing

SerialPort

Console

Threading

Page 20: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

AgendaIncreased Productivity

IO

FriendAssemblies

Strongly TypedResources

RAD Debugging

Increased Productivity, Ease-Of-UseFaster code-development by being simpler to use,

and easier to find

Generics

TryParse

Memory Pressure

EventLog

Environment

Tracing

SerialPort

Console

Threading

Page 21: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Strongly-Typed Resources

In this demo, we’ll see how working with resources has become even easier, with

strongly-typed resources

Page 22: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Private/DimPrivate/Dim??????privateprivate??????protectedprotectedInternalInternalprotected internalprotected internalpublicpublic ProtectedProtectedFriendFriendProtected FriendProtected FriendPublicPublic

Friend Assemblies

Today, you have these options…Today, you have these options…

class Foo {}

class SubFoo : Foo {}

class SomeClassA {}

class Foo {}

class SubFoo : Foo {}

class SomeClassA {}

class SubFoo2 : Foo {}

class SomeClassB {}

class SubFoo2 : Foo {}

class SomeClassB {}

class SomeClassC {}class SomeClassC {}

C#C# VBVB

AssemAAssemA AssemBAssemB

AssemCAssemC

How can AssemA make itself visible to everything in AssemB, but NOT AssemC?How can AssemA make itself visible to

everything in AssemB, but NOT AssemC?

Page 23: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Applies to assemblies only

Step 2Reference the class!

class Bar {Foo f = new Foo();

}

Friend AssembliesUsing InternalsVisibleToAttribute

[assembly:InternalsVisibleTo(“AssemB”,PublicKeyToken=”32ab4ba45e0a69a1” )]

internal class Foo {public Foo() {}

}

Step 1Apply the attribute

AssemB // wants to access Foo

AssemA

Page 24: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

AgendaFaster, Resource Aware Code

Faster, Resource Aware codeCode that runs faster, and more often

IO

FriendAssemblies

Strongly TypedResources

RADDebugging

Generics

TryParse

Memory Pressure

EventLog

Environment

Tracing

SerialPort

Console

Threading

Page 25: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

public class Listpublic class List{{ private private objectobject[] elements;[] elements; private int count;private int count;

public void Add(public void Add(objectobject element) { element) { if (count == elements.Length) Resize(count * 2);if (count == elements.Length) Resize(count * 2); elements[count++] = element;elements[count++] = element; }}

public public objectobject this[int index] { this[int index] { get { return elements[index]; }get { return elements[index]; } set { elements[index] = value; }set { elements[index] = value; } }}

public int Count {public int Count { get { return count; }get { return count; } }}}}

public class public class ListList<T><T>{{ private private TT[] elements;[] elements; private int count;private int count;

public void Add(public void Add(TT element) {element) { if (count == elements.Length) Resize(count * 2);if (count == elements.Length) Resize(count * 2); elements[count++] = element;elements[count++] = element; }}

public public TT this[int index] { this[int index] { get { return elements[index]; }get { return elements[index]; } set { elements[index] = value; }set { elements[index] = value; } }}

public int Count {public int Count { get { return count; }get { return count; } }}}}

Generics

List intList = new List();List intList = new List();

intList.Add(1);intList.Add(1);intList.Add(2);intList.Add(2);intList.Add("Three");intList.Add("Three");

int i = (int)intList[0];int i = (int)intList[0];

List intList = new List();List intList = new List();

intList.Add(1); intList.Add(1); // Argument is boxed // Argument is boxedintList.Add(2); intList.Add(2); // Argument is boxed // Argument is boxedintList.Add("Three");intList.Add("Three"); // Should be an error // Should be an error

int i = (int)intList[0]; int i = (int)intList[0]; // Cast required // Cast required

ListList<int><int> intList = new List intList = new List<int><int>();();

intList.Add(1); intList.Add(1); // No boxing // No boxingintList.Add(2); intList.Add(2); // No boxing// No boxingintList.Add("Three"); intList.Add("Three"); // Compile-time error// Compile-time error

int i = intList[0]; int i = intList[0]; // No cast required // No cast required

Before GenericsBefore Generics

Page 26: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Generics In VBPublic Class ListPublic Class List((Of TOf T))          Private elements() As Private elements() As TT          Private elementcount As IntegerPrivate elementcount As Integer          Public Sub Add(ByVal element As Public Sub Add(ByVal element As TT))                    If elementcount = elements.Length ThenIf elementcount = elements.Length Then

Resize(elementcount * 2)Resize(elementcount * 2)                    elements(elementcount) = elementelements(elementcount) = element                    count += 1count += 1          End SubEnd Sub          Public Default Property Item(ByVal index As Integer) As Public Default Property Item(ByVal index As Integer) As TT                    GetGet                            Return elements(index)Return elements(index)                    End GetEnd Get                    Set (ByVal Value As Set (ByVal Value As TT))              elements(index) = Value              elements(index) = Value                    End SetEnd Set          End PropertyEnd Property          Public ReadOnly Property Count As IntegerPublic ReadOnly Property Count As Integer                    GetGet                            Return elementcountReturn elementcount                    End GetEnd Get          End PropertyEnd PropertyEnd ClassEnd Class

Dim intList As New List(Dim intList As New List(Of IntegerOf Integer) )

intList.Add(1)          intList.Add(1)          // No boxing // No boxing intList.Add(2)         intList.Add(2)             // No boxing // No boxing intList.Add("Three")    intList.Add("Three")        // Compile-time error // Compile-time error

Dim i As Integer = intList(0)  Dim i As Integer = intList(0)    // No cast required  // No cast required

Page 27: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Generics In C++

generic<typename generic<typename TT>>public ref class List {public ref class List {      arrayarray<T><T>^ elements;^ elements;      int count;int count;public:public:      void Add(void Add(TT element) { element) {            if (count == elements->Length) Resize(count * 2);if (count == elements->Length) Resize(count * 2);            elements[count++] = element;elements[count++] = element;      }}      property property TT default [int index] { default [int index] {            TT get() { return elements[index]; } get() { return elements[index]; }            void set(void set(TT value) { elements[index] = value; } value) { elements[index] = value; }      }}      property int Count {property int Count {            int get() { return count; }int get() { return count; }      }}};};

ListList<int><int>^ intList = gcnew^ intList = gcnew ListList<int><int>();();

intList->Add(1);      intList->Add(1);                  // No boxing// No boxingintList->Add(2);        intList->Add(2);               // No boxing // No boxingintList->Add("Three");  intList->Add("Three");  // Compile-time error// Compile-time error  int i = intList[0];     int i = intList[0];         // No cast required    // No cast required

Page 28: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Enhancing The Base LibraryGeneric Collections

• System.Collections.Generic classes– List<ItemType>– Dictionary<K,V>– Stack<ItemType>– Queue<ItemType>

• System.Collections.Generic interfaces– IList<ItemType>– IDictionary<K,V>– ICollection<ItemType>– IEnumerable<ItemType>– IEnumerator<ItemType>– IComparable<OperandType>– IComparer<OperandType>

Page 29: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Enhancing The Base LibraryOther Generics to look out for

• Nullable<T>– Extremely useful for situations where null is a value, such as

database valuetypesNullable<int> intVal = Nullable<int>.default;intVal = 5; // implicit cast from int int i = (int)intVal; // explicit cast to int if (intVal.HasValue) { // checks for a value

• EventHandler<T>– Saves on making your own EventHandlers

delegate void EventHandler<T>(Object sender, T e) where T : EventArgs;

Page 30: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Enhancing The Base LibraryOther Generics to look out for

• IComparable<T>– No boxing of valuetypes on comparison/sorting– No chance of passing in an invalid type

public class DemoString : IComparable<string> { public int CompareTo(string other) ; public bool Equals(string other);}

• ArraySegment<T>– Allows you to easily specify a subsection of an array– Supports cleaner API designConstructor: public ArraySegment(T[] array, int

offset, int count);Old API: public void Send ( byte[], int, int );New API: public void Send ( ArraySegment<byte> );

Page 31: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Speeding Things Up: Parsing Values

In this demo, we'll see how TryParse can save you precious milliseconds, when comparing it to the traditional Parse

routines

Page 32: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

ThreadingSemaphore

• Resource counting for mutex’s// construct a semaphore with a count of 2Semaphore sem = new Semaphore(2);

private void UseResource {// Wait until a count is available…sem.WaitOne(); // the sem count is reduced by one

// other code …

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

Page 33: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

AgendaNew Managed Solutions

IO

FriendAssemblies

Strongly TypedResources

RAD Debugging

Generics

TryParse

Memory Pressure

EventLog

Environment

Tracing

SerialPort

Console

New Managed SolutionsManaged solutions which weren’t available in V2003

Threading

Page 34: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Console: Additional Features

In this demo, we’ll see additional Console features making the Console a more robust experience

Page 35: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Others…

• New String APIs, to make tasks easier, and make the most appropriate code easier– Remove( startIndex )– Contains ( someString )– Split ( char(), omitEmptyEntries )

• IO ACLs• Named Events in Threading• Timing out streams• IO: Decompression support• Transactions• RegularExpressions: character

class subtraction• Performant scenarios for resources

Page 36: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Summary

• Features have been introduced to provide:– An easier, better programming experience– Faster, more resource aware code– More managed solutions

• Focus has been on evolution, not revolution

Keep those requests coming!

• Features have been introduced to provide:– An easier, better programming experience– Faster, more resource aware code– More managed solutions

• Focus has been on evolution, not revolution

Keep those requests coming!

Page 37: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Designer Features

Page 38: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Designer Features

• More in-situ design experience, reduce obligatory visits to– the property grid– toolbars– menus

• Streamline common tasks– reduce clicks– reduce amount of code necessary

Page 39: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Feature List

• Snaplines • Smart tags• New selection UI / Semi-transparent dragging• In-situ string property editing• Document Outline• Toolbox improvements• Control Position / Size in Statusbar

• Runtime Features– Visual Styles– GDI Text

Page 40: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Snaplines

• Replaces grid layout mode• In-situ alignment (natural extension of IDE toolbar items

“Align Tops”, etc.)• Like snaps to like (e.g. left border to left, etc.), exposes

margins/padding• Controls can expose “interesting points”

– TextBox and Label “baseline” snapline

Page 41: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Snaplines (cont)

• New features: – Respects the new padding and margin properties on

controls– These values will be set to Windows UI style

guidelines– Works for resize operations– Supports multiselection– Initial control creation

Page 42: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

In-Situ String Editing

• Ability to edit a single property for all controls at once.• Similar to tab order editor in v1.1• Only works for string properties

Page 43: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Smart Tasks

• In-situ tasks, immediate• Extensible by 3rd parties

Page 44: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

New Selection UI

• Reduced number of handles• Reduced size of UI• Rounded to look good with visual styles• ... but still tweaking ...

Page 45: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Dragging UI Improvements

• Real-time control rendering -- WYSIWYG• Semi-transparent

Page 46: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Document Outline View

• Not just for HTML anymore!• Allows easy control navigation, Z-order

modification, parenting

Page 47: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Toolbox Improvements

• Auto-population• Informative tooltips• Search/filter

Page 48: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Location / Size information in the Statusbar

Page 49: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Visual Styles

• Visual styles just work and are on by default– Setting the FlatStyle property is no longer necessary– Manifest is no longer necessary

• VS and the design experience will support visual styles• Visual Style APIs

– High level control based API for common drawing operations– Low level theme API for drawing theme parts– Low level API will be strongly typed for the beta– Works in semi trust

Page 50: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

GDI Text Rendering

• GDI+ text is resolution independent– It doesn’t look like GDI text

• GDI text benefits from 10+ years of hardware acceleration

• GDI text has better globalization character set support on XP and above

Page 51: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

GDI Text Continued

• Added System.Windows.Forms.GDI namespace• Added a new TextRender class for text

drawing– Provides a stateless API

• Added new WindowsFont class to encapsulate GDI fonts

• All Windows Forms controls use GDI text by default

Page 52: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

ClientClientServerServerOfficeOffice

ClientClientServerServerOfficeOffice

Page 53: Neno Loje Microsoft Student Partner Universität Hamburg Microsoft.NET Framework 2.0.

Fragen?