Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "1 Lap Around The WinFX And Windows SDKs Brent Rector Program Manager Microsoft Corporation FUNL02."— Presentation transcript:

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

2 2 Agenda Introduction to the Windows SDK Breadth of new APIs Development and debugging tools Comand Shell Performance Analysis Tools

3 3 The WinFX SDK Contains documentation, samples, tools and build environments for the WinFX programming model Ships with each WinFX CTP and Windows Vista pre-release WinFX is rapidly evolving.NET Framework 2.0 Windows Presentation Foundation (Avalon) Windows Communication Foundation (Indigo) More to be announced… Will be released concurrently with Windows Vista WinFX Runtime Components for Windows XP and Windows 2003 Server

4 4 The Windows SDK The Windows SDK is the SDK for developing Windows applications Contains documentation for all APIs, interfaces, types, etc. found in the Windows operating system Also contains samples, tools and build environments The Windows SDK includes all the content you would previously have found in the Platform SDK Typically unmanaged APIs, samples and tools The Windows SDK also contains the WinFX SDK

5 5 APIs New To Vista ~ 4,000 new unmanaged APIs in Beta 1 ~ 1,400 additional new APIs so far in Beta 2 Many more are coming…

6 6 WinFX RC changes

7 7 XML Tools, Debug Tools XSD.exe XML Serializer Mdbg.exeFusLogVw.exe

8 8 Reading and Writing Xml Lots of squirrelly brackets Lots of approaches strtok, printf, XmlReader, XmlWriter Xsd.exe with XML Serializer – my favorite Class Object Schema Document

9 9 Xsd.exe XML schema – class generator XML schema ->.NET class xsd.xsd /classes|dataset [/e:] [/l:] [/n:] [/o:] [/s] [/uri:].NET class -> XML Schema xsd.dll|.exe [/outputdir:] [/type: [...]] XML document -> Inferred schema xsd.xml [/outputdir:] XDR schema -> XSD schema xsd.xdr [/outputdir:]

10 10 Xsd.exe

11 11 Xml Serialization The good, the bad, and the ugly Good - Easy to use Bad – Maybe not as efficient as assumed Ugly – Details to follow Finally, the attractive swan

12 12 Xml Serialization Two XML serializable classes public 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; public string Name { public string Name { get { return m_name; } get { return m_name; } set { m_name = value; } set { m_name = value; } } public int Age { public int Age { get { return m_age; } get { return m_age; } set { m_age = value; } set { m_age = value; } } public Pet Pet { public Pet Pet { get { get { return m_pet; return m_pet; } set { set { m_pet = value; m_pet = value; } } } } 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 13 Xml Serialization Easy to use using System.Xml.Serialization; 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 14 XmlSerializer

15 15 Xml Serialization Not as performant as you might expect Four assembly probe failures Two in-memory compiles Two assembly loads

16 16 Mdbg

17 17 Xml Serialization Details MSH> Mdbg MDbg (Managed debugger) v2.0.50215.322 (beta2PLUS.050215-3200) started. Copyright (C) Microsoft Corporation. All rights reserved. For information about commands type "help"; to exit program type "quit". mdbg> ca ml mdbg> ca lm mdbg> run XmlTest.exe STOP: Module loaded: D:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll STOP: Module loaded: D:\Users\BrentRe\Documents\PDCDemo\XmlTest.exe STOP: Module loaded: D:\Users\BrentRe\Documents\PDCDemo\Person.DLL STOP: Module loaded: D:\Users\BrentRe\Documents\PDCDemo\Pet.DLL STOP: Module loaded: D:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll STOP: Module loaded: D:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll STOP: Module loaded: D:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll STOP: MDANotification Name=BindingFailure XML= XML= <!-- 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 binding display 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:msg> [p#:0, t#:0] mdbg>

18 18 Fusion Log Viewer Fusion is the name of the assembly binding component in the OS Fusion log viewer displays attempts made by Fusion to find a managed assembly FusLogVw.exe tips Run it, enable logging, shut it down, restart it Clear the Internet Explorer cache

19 19 Fusion Log Viewer (FusLogVw)

20 20 Fusion Log Viewer FusLogVw.exe

21 21 Sample Fusion Log *** Assembly Binder Log Entry (8/12/2005 @ 11:29:57 AM) *** The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50215\mscorwks.dll Running under executable D:\Temp\MyClient.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = REDMOND\brentre LOG: DisplayName = Person.XmlSerializers, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL (Fully-specified) (Fully-specified) LOG: Appbase = file:///D:/Temp/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = MyClient.exe Calling assembly : System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. === LOG: This bind is in default load context. LOG: No application configuration file found. LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50215\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based 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/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/Person.XmlSerializers.EXE. LOG: All probing URLs attempted and failed.

22 22 Xml Serialization Easy to improve Sgen.exe The Xml Serialization Proxy Generator SGen /a:Person.dll /r:Pet.dll [/debug] [/keep] Creates an assembly that contains classes that can serialize specified classes as XML No need to compile against this assembly Dynamically loaded as needed

23 23 Xml Serialization Easy to improve XmlSerializer tries to load an assembly that contains a type that can serialize the specified class Will generate and compile source code for such an assembly at runtime when one cannot be loaded Why not generate and compile this source code during development?

24 24 Xml Serialization Easy to improve Sgen.exe The Xml Serialization Proxy Generator SGen /a:Person.dll /r:Pet.dll [/debug] [/keep]

25 25 Serialization Assembly Generator (Sgen)

26 26 Build Tools MSBuild An XML-based managed code build tool Items, Properties, Tasks, Targets VCBuild An XML-based unmanaged C++ build tool NMake A standard Makefile processing tool

27 27 Command Shells CMD.EXE Old, familiar, batch file command shell MSH.EXE New, unfamilar, shell script command shell

28 28 Microsoft Command Shell

29 29 WPF UI Tools Xamlpad.exe Enter XAML, see how it renders immediately Perforator Visual display of rendering requirements UISpy.exe Spy++ for XAML Planned for WinFX SDK Beta 2

30 30 XamPad

31 31 Perforator

32 32 Interesting Samples WPF Sample Gallery MSBuild Project File Generator SdkDiff

33 33 Summary Visual Studio 2005 is best for daily development Common line development environment still very useful SDK has lots of sample code > 700 samples in the Windows SDK SDK is the ultimate documentation source

34 34 Contact Information Brent.Rector@microsoft.com Track Lounge Tuesday, Sept 13 – 14:15 to 17:30 Thursday, Sept 15 – 15:15 to 18:30

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


Download ppt "1 Lap Around The WinFX And Windows SDKs Brent Rector Program Manager Microsoft Corporation FUNL02."

Similar presentations


Ads by Google