Dr. Frank Prengel Embedded Evangelist Microsoft Deutschland GmbH.

Post on 06-Apr-2016

225 views 0 download

Tags:

Transcript of Dr. Frank Prengel Embedded Evangelist Microsoft Deutschland GmbH.

Smartere Devices mit Visual Studio 2008 und dem .NET Compact Framework 3.5Dr. Frank Prengel

Embedded EvangelistMicrosoft Deutschland GmbH

DEVICES

AgendaMarkt & InfrastrukturDeviceentwicklung & Microsoft: Was bisher passierteVisual Studio 2008 for Devices

WermutstropfenNeue Möglichkeiten

.NET Compact Framework 3.5SQL Server Compact Edition 3.5

Wussten Sie schon…?

The world champion record is held by Mikko Lampi. He threw 94,97 metres in 2005.

Mobile Lösungen im TrendYO

Y %

shi

ppin

g gr

owth

35

30

25

20

15

10

5

02006-2010

SOURCE: Gartner Dataquest, and IDC 2006

18.6%Mobile PCs

5.8%Mobile Phones

3.9%Desktop PCs

34.1%ConvergedMobile Phones

Enterprise Ready Mobility

Der Werkzeugkasten

Embedded Visual Tools 3.0

Microsoft eMbedded Visual C++ 4.0

Visual Studio .NET 2003

Visual Studio 2005

Visual Studio 2008

eVB, eVCWindows CE 3.0

Managed & Native!Desktop Parity, Designers, Data

Device Emulator 1.0 & 2.0*.NET CF Framework 1.0 & 2.0

Microsoft Windows CE 5.0 & 6.0Smartphone & Pocket PC 2003,

Windows Mobile 5.0*Windows Mobile 6*

SQL Server 2005 Mobile

Native & ManagedDevice Emulator 3.0

Security Aware IDE / Unit TestingWindows CE 5.0 and CE 6.0

Windows Mobile 2003 Smartphone** & Pocket PC (**Nur Native)

Windows Mobile 5.0 SmartphoneWindows Mobile 5.0 Pocket PC

Windows Mobile 6 Professional*Windows Mobile 6 Standard*

.NET Compact Framework 2.0 & 3.5SQL Server Compact Edition 3.5

Nur ManagedWindows CE 4.2.NET Compact Framework 1.0Smartphone & Pocket PC 2003

Nur NativeWindows CE 4.x, 5.0

Smartphone & PPC 2003x86 Emulator

* separater Download

Introducing…

Vorweg: Wermutstropfen … oder: Entdecke die Unmöglichkeiten

Device-Entwicklung mit VS 2008 erst ab Professional Edition

Vorweg: Wermutstropfen … oder: Entdecke die Unmöglichkeiten

Kein Hosting von Platform Builder 6.0 für Windows Embedded CE 6.0

Vorweg: Wermutstropfen … oder: Entdecke die Unmöglichkeiten

Keine Templates & Designer für ASP.NET Mobile Web Sites

Neu in Visual Studio 2008Unit Testing for Devices

Device Configuration Manager

Device Certificate Manager

Device Emulator Version 3.0

Windows Mobile 5.0 SDK "in the box"

.NET Compact Framework 2.0 SP2 + 3.5

Updates für Compiler, MFC, Tools

Managed CoreCon Framework

{ VS 2008 for Devices}

Demo

Unit Testing for DevicesUnit-Test-Unterstützung für NETCF-AnwendungenGleiche "Experience" wie bei Desktop-AnwendungenNahtlose Integration mit Team System und Team Foundation ServerEinfaches Testen für diverse KonfigurationsszenarienUnterstützt Testausführung von der Kommandozeile

Testausführung… auf verschiedenen Geräten oder Emulatoren möglich durch Editieren der Konfiguration

Testausführung: Was läuft?Hostadapter für Smart Devices klinkt sich in die Hostadapter-Architektur der Testing-Tools einKopiert (binäre) Dateien auf Device/EmulatorStartet SmartDeviceTestHost.exe auf dem Device/Emulator – Tests werden ausgeführt und Resultate an VS auf dem Desktop kommuniziertAm Schluss werden Log-Dateien zurückkopiert

Was geht nicht?Nicht unterstützt sind

Code CoveragePerformance Session

{ Device Testing }

Demo

Erinnerung: Gerätesicherheit"Security through identity"Zertifikate: X.509 identifiziert den Hersteller

Mobile2MarketPrivilegien: unsigned, unprivileged, privilegedAusführung: normal, trustedStart: normal, User Prompt, verhindertKonfigurationen:

One-Tier Pocket PCTwo-Tier Smartphone

Permission (Privileged/Normal/Blocked)

Certificate Application

Authentication Certificate Stores

Security configuration User prompt

Gerätesicherheitsmanagement

Konfiguration der Gerätesicherheit (Device Configuration Manager)

Sicherheitsrichtlinien überprüfen und setzenSicherheitseinstellungen exportierenEigene Sicherheitsrichtlinien erstellen

Zertifikatsverwaltung auf dem Gerät (Device Certificate Manager)

Zertifikate einsehenZertifikate hinzufügen oder entfernen

{ Geräteverwaltung }

Demo

Managed CoreCon Framework

Basiert auf existierendem Core Connectivity FrameworkWird intern von MS-eigenen Tools verwendet (z.B. Unit Testing)Macht das Erstellen eigener Remote-Tools leichtReferenz hinzufügen auf:

Microsoft.Smartdevice.Connectivity.dll

Device Emulator 3.0Verfügbar mit Visual Studio 2008

Evolutionäre Weiterentwicklung von Version 2.0

VerbesserungenUnterstützung für Automatisierung (COM)Zugriff auf Interfaces über VBScriptEinfaches Hinzufügen eigener Images im Device Emulator ManagerXML-File zur Konfiguration von Emulator-Instanzen

3.5

Versionen und Schwerpunkte

.NET für DevicesVerteilte AnwendungenMobile Daten

PerformanceFeaturesTools

2002 2003 2004 2005 2006 2007

1.0 1.0 SP1

1.0 SP2

2.01.0 SP3

2.0 SP1

3.5XNA

2.0 SP2

LandscapeAutoscroll

Smartphone

HeadlessWindows CE 4.2Remote Performance Monitor

PerformanceGenericsCOM InteropDirect3D

Windows Communication FoundationLanguage Integrated QueryCLR Profiler

.NET Compact Framework 3.5

WCF "Light" incl. Store-And-Forward Channel

LINQ (XML, Objekte, DataSet)Neues Tool: CLR ProfilerKompressionClient-Side-ZertifikateSound API Diverse Verbesserungen & Fixes

NETCF + verteilte Anwendungen

Kommunikation für Online-/Offline-Situationen einfacher implementierenServer soll Kommunikation mit Geräten initiierenAnwendungen sollen von Gerät zu Gerät kommunizieren können (P2P)WCF für die mobile Welt

WCF im NETCF 3.5Desktop (>10 MB) Device (< 1 MB)

Endpoints, Contracts,Config files,etc…

Messages,Bindings, Transports

WCF im NETCF 3.5: Features

http://blogs.msdn.com/andrewarnottms/archive/2007/08/21/The-WCF-subset-supported-by-NetCF.aspx

Transport

HTTP

TCP

Pipes

MSMQ

Exchange

Custom

Encoding Security Reliability

Protocol

Text

Binary

Custom

MTOM

WS-*

Custom

WS-*

Custom

WS-*

Custom

HTTP Text WS-*

"Occasional Connectivity"Grundproblem mobiler Anwendungen

Adresse und IdentitätIP-Adresse des Mobilgeräts kann wechseln und (serverseitig) nicht erkannt werdenDynamic DNS und IPv6 noch nicht universell verfügbarTCP/HTTP nur zum "Herausrufen" vom Gerät ausEchtes P2P nicht machbar

QoS (intermittente Verbindungen)Anwendungen müssen explizit Offline-Status voraussetzenBenötigt wird eine Möglichkeit, Nachrichten aufzubewahren und erst bei Verbindung zu versenden ("store and forward")

Die Lösung?

Store And Forward Messaging

"WCF über Email"Email-Infrastruktur löst Adressierbarkeits- und ErreichbarkeitsproblemeKonsistentes Programmiermodell für Windows Mobile und Windows auf PCsNutzt Erweiterbarkeit der WCF-Architektur

Spezieller "store-and-forward"-Transportkanal über Email

Nutzt ActiveSync “Always-Up-To-Date”-Funktion ("Push Email") und Exchange 2007 Web Services

Adressschema

Application 1

Application 2

john@microsoft.com

Application 4

Application 3

Channel Name Distribution listScheme Separator

net.mail://sales/orderschannel#service@company.com

{ Store & Forward }

Demo

{ Store & Forward }

Demo http://blogs.msdn.com/frankprhttp://www.techfiles.de/frankpr/WCFCompact.wmv

LINQ im NETCF 3.5Kompatible Teilmenge der Funktionalität im .NET Framework 3.5

LINQ to ObjectsLINQ to XMLLINQ to DataSet, DataTable

Nicht verfügbar:LINQ to SQLExpression Trees

LINQ to Objects

using System;

using System.Linq;

using System.Collections.Generic;

class app {

static void Main() {

string[] names = { "Burke", "Connor", "Frank", "Everett", "Albert", "George", "Harris", "David" };

IEnumerable<string> expr = from s in names

where s.Length == 5

orderby s

select s.ToUpper();

foreach (string item in expr)

Console.WriteLine(item);

}

}

BURKEDAVIDFRANK

XML: Vor LINQ (d.h. DOM)

XmlDocument doc = new XmlDocument();XmlElement books = doc.CreateElement("Books"); XmlElement book = doc.CreateElement("Book");XmlElement title = doc.CreateElement("Title");XmlElement price = doc.CreateElement("Price"); doc.AppendChild(books);books.AppendChild(book);book.AppendChild(title);book.AppendChild(price);

title.AppendChild(doc.CreateTextNode("Short DOM reference, vol.5"));price.AppendChild(doc.CreateTextNode("99.95"));

doc.Save(“MyBooks.xml”);

<Books> <Book> <Title>Short DOM reference, vol.5</Title> <Price>99.95</Price> </Book></Books>

LINQ to XML

XDocument doc =new XDocument( new XElement("Books", new XElement("Book", new XElement("Title", "What to do in spare time freed up from XML programming."), new XElement("Price", "19.95") ) ))

doc.Save(“MyBooks.xml”);

<Books> <Book> <Title>What to do in spare time freed up from XML programming.</Title> <Price>19.95</Price> </Book></Books>

Neue APIsSie haben sich gewünscht:

KompressionClient-Side-ZertifikateSoundWindows Forms-VerbesserungenPlattform-Identifikation

Bsp.: Plattform-ID

using Microsoft.WindowsCE.Forms;…

textBox1.Text = SystemSettings.Platform.ToString();

NETCF 3.5 Power Toys

NETCF 3.5 Power ToysRemote Performance Monitor, GC Heap Viewer (Update)NETCF CLR Profiler App Configuration Tool (NetCFcfg.exe)NETCF ServiceModel Metadata Tool (netcfsvcutil.exe)Remote Logging Configuration Tool NETCF Network Log Viewer

{ Power Toys }

Demo

• Sehr kleine (~1MB) Embedded-, In-Proc-DB• Subset der SQL Server-Typen und -Sprache• Keine Stored Procs, Views, Xquery

• Warum T-SQL, wenn man Managed Code haben kann?

Was?

• Mobile & Embedded-Geräte• Windows Vista, Media Center PC, MSN Client,

ZUNE, Windows Media Player, …• Default für Lokale DB in VS 2008

Wo?

• Lokaler Online / Offline-Cache• Lokale DB für Stand-Alone-Apps• Persistieren von Daten aus In-Memory-

Caches• Strukturiertes Dokumentenformat für Apps

Wofür?

‘06

SQL Server

Compact 3.1

‘01

SQL Server CE

1.0

‘05

SQL Server

Compact 3.5

‘07

Embedded-DB für Devices – eVC, eVB

Synchronisierung mitSync Services for ADO.NET

‘03

SQL Server CE

2.0.NET Compact Framework unterstützt

Tablet PC-UnterstützungSQL Server Mobile

3.0

Alle Desktop-Szenarien möglich

* Interne Verwendung in Windows: Vista

Funktionserweiterungen nach Kundenfeedback

Neu in SSCE 3.5Neues Dateiformat

Konvertierung notwendigVS2008 / SQL2008 Mgmt Studio als ToolPK/FK-Auswahl im Table Designertimestamp (rowversion)-DatentypNeue T-SQL-StatementsStärkere Verschlüsselung

(Nur für Desktop: LINQ to SQL, Sync Services)

Upgrade 3.1 3.5

Neue T-SQL-StatementsNested Query in SELECT FROMCROSS APPLY & OUTER APPLYCAST TOP SET IDENTITY INSERT

ZusammenfassungVisual Studio 2008 bringt kleine und große Neuerungen

… und (fast) alle Features von VS 2005.NET Compact Framework 3.5 vereinfacht

OCS-Lösungen ("store and forward" WCF)Datenzugriff (LINQ)Debugging & Profiling (Power Toys)

SQL Server Compact Edition 3.5 ohne umwälzende NeuerungenFazit: Device-Entwicklung wird leichter!

A. Wigley, D. Moth, P. Foot:Microsoft MobileDevelopment Handbook

http://www.microsoft.com/mspress/books/10294.aspx

Literatur

LiteraturRob Tiffany:

Windows MobileData Synchronizationwith SQL Server 2005and SQL Server Compact 3.1

http://blogs.msdn.com/robtiffany/

Douglas Boling:Programming Windows® Embedded CE 6.0 Developer Reference, Fourth Edition

http://www.microsoft.com/mspress/books/11064.aspx

Literatur

Noch Fragen?

?

Vielen Dank!

http://blogs.msdn.com/frankpr

© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after

the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.