35
1 Lap Around The Lap Around The WinFX And Windows SDKs WinFX And Windows SDKs Brent Rector Brent Rector Program Manager Program Manager Microsoft Corporation Microsoft Corporation FUNL02 FUNL02

1 Lap Around The WinFX And Windows SDKs Brent Rector Program Manager Microsoft Corporation FUNL02

Embed Size (px)

Citation preview

1

Lap Around TheLap Around TheWinFX And Windows SDKsWinFX And Windows SDKs

Brent Rector Brent Rector Program ManagerProgram ManagerMicrosoft CorporationMicrosoft Corporation

FUNL02FUNL02

2

AgendaAgenda

Introduction to the Windows SDKIntroduction to the Windows SDK

Breadth of new APIsBreadth of new APIs

Development and debugging toolsDevelopment and debugging tools

Comand ShellComand Shell

Performance Analysis ToolsPerformance Analysis Tools

3

The WinFX SDKThe WinFX SDK

Contains documentation, samples, tools Contains documentation, samples, tools and build environments for the WinFX and build environments for the WinFX programming modelprogramming model

Ships with each WinFX CTP and Windows Ships with each WinFX CTP and Windows Vista pre-releaseVista pre-release

WinFX is rapidly evolvingWinFX is rapidly evolving.NET Framework 2.0.NET Framework 2.0

Windows Presentation Foundation (Avalon)Windows Presentation Foundation (Avalon)

Windows Communication Foundation (Indigo)Windows Communication Foundation (Indigo)

More to be announced…More to be announced…

Will be released concurrently with Windows Will be released concurrently with Windows VistaVista

WinFX Runtime Components for Windows XP and WinFX Runtime Components for Windows XP and Windows 2003 ServerWindows 2003 Server

4

The Windows SDKThe Windows SDK

The Windows SDK is the SDK for The Windows SDK is the SDK for developing Windows applicationsdeveloping Windows applications

Contains documentation for all APIs, Contains documentation for all APIs, interfaces, types, etc. found in the interfaces, types, etc. found in the Windows operating systemWindows operating system

Also contains samples, tools and build Also contains samples, tools and build environmentsenvironments

The Windows SDK includes all the content The Windows SDK includes all the content you would previously have found in the you would previously have found in the Platform SDKPlatform SDK

Typically unmanaged APIs, samples and toolsTypically unmanaged APIs, samples and tools

The Windows SDK also contains the The Windows SDK also contains the WinFX SDKWinFX SDK

5

APIs New To VistaAPIs New To Vista

~ 4,000 new unmanaged APIs in Beta 1~ 4,000 new unmanaged APIs in Beta 1

~ 1,400 additional new APIs so far in ~ 1,400 additional new APIs so far in Beta 2Beta 2

Many more are coming…Many more are coming…

0

100

200

300

400

500

600

700

Technolgies

Application Quality

Collaboration

Communication Infrastructure

Data Servers

File System

Gaming

Graphics

Installation and Update

Manageability

Media

Mobile

New Visuals

Presentation Infrastructure

Search and Organize

Secure Applications

Shell

System Internals

Tablet

Tools

Web Services

6

WinFX RC changesWinFX RC changes

0

2000

4000

6000

8000

10000

12000

.NET 1.0 .NET 1.1 .NET 2.0 WinFX

Types

0

50

100

150

200

250

300

.NET 1.0 .NET 1.1 .NET 2.0 WinFX

Namespaces

010000

200003000040000

500006000070000

8000090000

100000

.NET 1.0 .NET 1.1 .NET 2.0 WinFX

Members

7

XML Tools, Debug ToolsXML Tools, Debug Tools

XSD.exeXSD.exe

XML SerializerXML Serializer

Mdbg.exeMdbg.exe

FusLogVw.exeFusLogVw.exe

8

Reading and Writing XmlReading and Writing XmlLots of squirrelly bracketsLots of squirrelly brackets

Lots of approachesLots of approachesstrtok, printf, XmlReader, XmlWriterstrtok, printf, XmlReader, XmlWriter

Xsd.exe with XML Serializer – my favoriteXsd.exe with XML Serializer – my favorite

ClassClass ObjectObject

SchemaSchema DocumentDocument

9

Xsd.exeXsd.exeXML schema – class generatorXML schema – class generator

XML schema -> .NET classXML schema -> .NET classxsd <schema>.xsd /classes|dataset [/e:] [/l:] [/n:] [/o:] [/s] [/uri:]xsd <schema>.xsd /classes|dataset [/e:] [/l:] [/n:] [/o:] [/s] [/uri:]

.NET class -> XML Schema.NET class -> XML Schemaxsd <assembly>.dll|.exe [/outputdir:] [/type: [...]]xsd <assembly>.dll|.exe [/outputdir:] [/type: [...]]

XML document -> Inferred schemaXML document -> Inferred schemaxsd <instance>.xml [/outputdir:]xsd <instance>.xml [/outputdir:]

XDR schema -> XSD schemaXDR schema -> XSD schemaxsd <schema>.xdr [/outputdir:]xsd <schema>.xdr [/outputdir:]

10

Xsd.exeXsd.exe

11

Xml SerializationXml SerializationThe good, the bad, and the uglyThe good, the bad, and the ugly

Good - Easy to useGood - Easy to use

Bad – Maybe not as efficient as Bad – Maybe not as efficient as assumedassumed

Ugly – Details to followUgly – Details to follow

Finally, the attractive swanFinally, the attractive swan

12

Xml SerializationXml SerializationTwo XML serializable classesTwo XML serializable classespublicpublic class Person { class Person { private int m_age;private int m_age; private string m_name; private string m_name; private Pet m_pet; private Pet m_pet;

publicpublic string Name { string Name { get { return m_name; }get { return m_name; } set { m_name = value; }set { m_name = value; } }} publicpublic int Age { int Age { get { return m_age; }get { return m_age; } set { m_age = value; }set { m_age = value; } }} publicpublic Pet Pet { Pet Pet { get {get { return m_pet;return m_pet; }} set {set { m_pet = value;m_pet = value; }} }}

}}

public class Pet {public class Pet { private System.DateTime m_birthDate;private System.DateTime m_birthDate; private string m_name; private string m_name;

public string Name {public string Name { get { return m_name; }get { return m_name; } set { m_name = value; }set { m_name = value; } }} public System.DateTime BirthDate {public System.DateTime BirthDate { get { return m_birthDate; }get { return m_birthDate; } set {m_birthDate = value; }set {m_birthDate = value; } }}}}

13

Xml SerializationXml SerializationEasy to useEasy to use

using System.Xml.Serialization;using System.Xml.Serialization;

static class App {static class App { static void Main () {static void Main () { XmlSerializer xs1 = new XmlSerializer (typeof (Person));XmlSerializer xs1 = new XmlSerializer (typeof (Person)); XmlSerializer xs2 = new XmlSerializer (typeof (Pet));XmlSerializer xs2 = new XmlSerializer (typeof (Pet)); . . .. . . }}}}

14

XmlSerializerXmlSerializer

15

Xml SerializationXml SerializationNot as performant as you might Not as performant as you might expectexpect

Four assembly probe failuresFour assembly probe failures

Two in-memory compilesTwo in-memory compiles

Two assembly loadsTwo assembly loads

16

MdbgMdbg

17

Xml SerializationXml SerializationDetailsDetails

MSH> MdbgMSH> MdbgMDbg (Managed debugger) v2.0.50215.322 (beta2PLUS.050215-3200) started.MDbg (Managed debugger) v2.0.50215.322 (beta2PLUS.050215-3200) started.Copyright (C) Microsoft Corporation. All rights reserved.Copyright (C) Microsoft Corporation. All rights reserved.

For information about commands type "help";For information about commands type "help";to exit program type "quit".to exit program type "quit".

mdbg> ca mlmdbg> ca mlmdbg> ca lmmdbg> ca lmmdbg> run XmlTest.exemdbg> run XmlTest.exeSTOP: Module loaded: D:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dllSTOP: Module loaded: D:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dllSTOP: Module loaded: D:\Users\BrentRe\Documents\PDCDemo\XmlTest.exeSTOP: Module loaded: D:\Users\BrentRe\Documents\PDCDemo\XmlTest.exeSTOP: Module loaded: D:\Users\BrentRe\Documents\PDCDemo\Person.DLLSTOP: Module loaded: D:\Users\BrentRe\Documents\PDCDemo\Person.DLLSTOP: Module loaded: D:\Users\BrentRe\Documents\PDCDemo\Pet.DLLSTOP: Module loaded: D:\Users\BrentRe\Documents\PDCDemo\Pet.DLLSTOP: Module loaded: D:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dllSTOP: Module loaded: D:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dllSTOP: Module loaded: D:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dllSTOP: Module loaded: D:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dllSTOP: Module loaded: D:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dllSTOP: Module loaded: D:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dllSTOP: MDANotificationSTOP: MDANotificationName=BindingFailureName=BindingFailureXML=<mda:msg xmlns:mda="http://schemas.microsoft.com/CLR/2004/10/mda">XML=<mda:msg xmlns:mda="http://schemas.microsoft.com/CLR/2004/10/mda"> <!-- An assembly failed to load, returning HRESULT 0x80070002. It would have had<!-- An assembly failed to load, returning HRESULT 0x80070002. It would have had display name 'Person.XmlSerializers', been loaded from code base '' in bindingdisplay name 'Person.XmlSerializers', been loaded from code base '' in binding context 1 of the AppDomain with ID 1.context 1 of the AppDomain with ID 1.

See D:\Windows\Microsoft.NET\Framework\v2.0.50215\sdk\bin\mdaBoilerplate.exe.mda.config for documentation.See D:\Windows\Microsoft.NET\Framework\v2.0.50215\sdk\bin\mdaBoilerplate.exe.mda.config for documentation. -->--> <mda:bindingFailureMsg break="true"><mda:bindingFailureMsg break="true"> <assemblyInfo appDomainId="1" displayName="Person.XmlSerializers" codeBase="" hResult="-2147024894" bindingContextId="1"/><assemblyInfo appDomainId="1" displayName="Person.XmlSerializers" codeBase="" hResult="-2147024894" bindingContextId="1"/> </mda:bindingFailureMsg></mda:bindingFailureMsg></mda:msg></mda:msg>

[p#:0, t#:0] mdbg>[p#:0, t#:0] mdbg>

18

Fusion Log ViewerFusion Log Viewer

Fusion is the name of the assembly Fusion is the name of the assembly binding component in the OSbinding component in the OS

Fusion log viewer displays attempts Fusion log viewer displays attempts made by Fusion to find a managed made by Fusion to find a managed assemblyassembly

FusLogVw.exe tipsFusLogVw.exe tipsRun it, enable logging, shut it down, Run it, enable logging, shut it down, restart itrestart it

Clear the Internet Explorer cacheClear the Internet Explorer cache

19

Fusion Log Viewer Fusion Log Viewer (FusLogVw)(FusLogVw)

20

Fusion Log ViewerFusion Log ViewerFusLogVw.exeFusLogVw.exe

21

Sample Fusion LogSample Fusion Log*** Assembly Binder Log Entry (8/12/2005 @ 11:29:57 AM) ****** Assembly Binder Log Entry (8/12/2005 @ 11:29:57 AM) ***

The operation failed.The operation failed.Bind result: hr = 0x80070002. The system cannot find the file specified.Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50215\mscorwks.dllAssembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50215\mscorwks.dllRunning under executable D:\Temp\MyClient.exeRunning under executable D:\Temp\MyClient.exe--- A detailed error log follows. --- A detailed error log follows.

=== Pre-bind state information ====== Pre-bind state information ===LOG: User = REDMOND\brentreLOG: User = REDMOND\brentreLOG: DisplayName = Person.XmlSerializers, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null, LOG: DisplayName = Person.XmlSerializers, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSILprocessorArchitecture=MSIL (Fully-specified)(Fully-specified)LOG: Appbase = file:///D:/Temp/LOG: Appbase = file:///D:/Temp/LOG: Initial PrivatePath = NULLLOG: Initial PrivatePath = NULLLOG: Dynamic Base = NULLLOG: Dynamic Base = NULLLOG: Cache Base = NULLLOG: Cache Base = NULLLOG: AppName = MyClient.exeLOG: AppName = MyClient.exeCalling assembly : System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.Calling assembly : System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.======LOG: This bind is in default load context.LOG: This bind is in default load context.LOG: No application configuration file found.LOG: No application configuration file found.LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50215\config\LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50215\config\machine.config.machine.config.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).assembly bind).LOG: Attempting download of new URL file:///D:/Temp/Person.XmlSerializers.DLL.LOG: Attempting download of new URL file:///D:/Temp/Person.XmlSerializers.DLL.LOG: Attempting download of new URL file:///D:/Temp/Person.XmlSerializers/Person.XmlSerializers.DLL.LOG: Attempting download of new URL file:///D:/Temp/Person.XmlSerializers/Person.XmlSerializers.DLL.LOG: Attempting download of new URL file:///D:/Temp/Person.XmlSerializers.EXE.LOG: Attempting download of new URL file:///D:/Temp/Person.XmlSerializers.EXE.LOG: Attempting download of new URL file:///D:/Temp/Person.XmlSerializers/Person.XmlSerializers.EXE.LOG: Attempting download of new URL file:///D:/Temp/Person.XmlSerializers/Person.XmlSerializers.EXE.LOG: All probing URLs attempted and failed.LOG: All probing URLs attempted and failed.

22

Xml SerializationXml SerializationEasy to improveEasy to improve

Sgen.exeSgen.exeThe Xml Serialization Proxy GeneratorThe Xml Serialization Proxy GeneratorSGen /a:Person.dll /r:Pet.dll [/debug] [/keep]SGen /a:Person.dll /r:Pet.dll [/debug] [/keep]

Creates an assembly that contains classes Creates an assembly that contains classes that can serialize specified classes as that can serialize specified classes as XMLXML

No need to compile against this assemblyNo need to compile against this assembly

Dynamically loaded as neededDynamically loaded as needed

23

Xml SerializationXml SerializationEasy to improveEasy to improve

XmlSerializer tries to load an XmlSerializer tries to load an assembly that contains a type that assembly that contains a type that can serialize the specified classcan serialize the specified class

Will generate and compile source Will generate and compile source code for such an assembly code for such an assembly at runtimeat runtime when one cannot be loadedwhen one cannot be loaded

Why not generate and compile this Why not generate and compile this source code during development?source code during development?

24

Xml SerializationXml SerializationEasy to improveEasy to improve

Sgen.exeSgen.exeThe Xml Serialization Proxy GeneratorThe Xml Serialization Proxy GeneratorSGen /a:Person.dll /r:Pet.dll [/debug] [/keep]SGen /a:Person.dll /r:Pet.dll [/debug] [/keep]

25

Serialization Assembly Serialization Assembly Generator (Sgen)Generator (Sgen)

26

Build ToolsBuild Tools

MSBuildMSBuildAn XML-based managed code build toolAn XML-based managed code build toolItems, Properties, Tasks, TargetsItems, Properties, Tasks, Targets

VCBuildVCBuild

An XML-based unmanaged C++ build An XML-based unmanaged C++ build tooltool

NMakeNMakeA standard Makefile processing toolA standard Makefile processing tool

27

Command ShellsCommand Shells

CMD.EXECMD.EXEOld, familiar, batch file command shellOld, familiar, batch file command shell

MSH.EXEMSH.EXENew, unfamilar, shell script command New, unfamilar, shell script command shellshell

28

Microsoft Command ShellMicrosoft Command Shell

29

WPF UI ToolsWPF UI Tools

Xamlpad.exeXamlpad.exeEnter XAML, see how it renders Enter XAML, see how it renders immediatelyimmediately

PerforatorPerforatorVisual display of rendering requirementsVisual display of rendering requirements

UISpy.exeUISpy.exeSpy++ for XAMLSpy++ for XAML

Planned for WinFX SDK Beta 2Planned for WinFX SDK Beta 2

30

XamPadXamPad

31

PerforatorPerforator

32

Interesting SamplesInteresting Samples

WPF Sample GalleryWPF Sample Gallery

MSBuild Project File GeneratorMSBuild Project File Generator

SdkDiffSdkDiff

33

SummarySummary

Visual Studio 2005 is best for Visual Studio 2005 is best for daily developmentdaily development

Common line development Common line development environment still very usefulenvironment still very useful

SDK has lots of sample codeSDK has lots of sample code> 700 samples in the Windows SDK> 700 samples in the Windows SDK

SDK is the ultimate documentation SDK is the ultimate documentation sourcesource

34

Contact InformationContact Information

[email protected]@microsoft.com

Track LoungeTrack LoungeTuesday, Sept 13 – 14:15 to 17:30Tuesday, Sept 13 – 14:15 to 17:30

Thursday, Sept 15 – 15:15 to 18:30Thursday, Sept 15 – 15:15 to 18:30

35

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