Nuno Filipe Godinho

All about WebDevelopment (ASP.NET & Silverlight)

Sponsors

April 2011 - Posts

MIX11 - Session Review - Powering Data on the Web and Beyond with SQL Azure

David Robinson (Senior Lead Program Manager)

SQL Azure Relational Database

  • Based on SQL Server 2008 R2 engine
  • Use same tools and data access frameworks
  • Six global datacenters
  • High Availability & Redundancy
    • Reads are completed at the primary
    • Writes are replicated to a quorum of secondaries

SQL Azure Roadmap

  • MIX08
    • Introduced SQL Server Data Services (ACE type)
  • MIX09
    • Introduce SQL Data Services (Real Relational Database)
  • MIX10
    • New Features announced
      • 50 GB Database
      • PHP Support
      • MARS support
      • OData Endpoint Preview
      • Geo Spatial Data Types

ASP.NET MVC 3

  • Razor view Engine which provides a very streamlined syntax for writing clean and concise views.
  • Improved support for Dependency Injection
  • Global Action Filters
  • jQuery based Unobtrusive Ajax and Client Validation
  • ViewBag property for dynamic access to ViewData
  • Support for view engine selection in the New Project and Add View dialog

Extending the Reach of Data

  • This is achieved using ODATA protocol
  • Cloud Data Services
    • Windows Azure Tables
    • SQL Azure
    • Windows Azure MarketPlace DataMarket
  • Powering Web/AJAX Experiences
    • Consuming ODATA via jQuery & JSON
  • Powering Windows Phone 7
    • ODATA libraries available for Windows Phone 7
  • Powering Interoperability on Other platforms

Why does Performance matters?

  • More responsive applications
  • Faster page load times
    • 8 seconds vs 3 seconds
  • Higher interactivity – new type of applications
  • Better User Experience – more $$$$

SQL Azure Data Sync

  • Sync within the Cloud
  • Read scale-out via multiple copies
    • reporting
    • web site reference data
  • Read-write scale-out via multiple copies:
    • ex. geo located web apps
  • Same or different data centers
  • Key features
    • No-Code sync configuration
      • Easily define data to be synchronized and locations
      • Choose how often data is synchronized
    • Full Data Synchronization Capabilities
      • Two-way sync of same data, as well as one-way sync
    • Conflict Handling
      • Detect and resolve conflicts caused by the same data being changed in multiple locations
    • Logging and Monitoring
      • Administration capabilities for tracking usage
    • Scale
      • Service scales as resources requirements grow
  • Currently there are 2 CTPs available
    • CTP 1 publicly available
    • CTP 2 invitation only
    • CTP 3 will be available by the end of the summer and will be feature complete

Geo Available Applications

  • Windows Azure Traffic Manager
    • This will help handle geo-locating SQL Azure Databases
    • This will manage the traffic
  • SQL Azure Data Sync
    • Syncs the SQL Azure Databases between regions

CY11 Investment Themes

  • Managed Services
    • Data Protection / Recovery
      • Local Backup/Point in Time Restore: to recover from user/apps errors
      • Geo Backup/Disaster Recovery from data center/geographical disasters
    • New Data Movement Capabilities
      • DB Import/Export of data and schema between SQL Azure and SQL Server
      • Migration Support to SQL Azure from Sybase, in addition to existing support for Access, MySQL and Oracle
    • Enhanced Management Experiences
      • Enhanced portal based experiences
      • Multiple DB administrators per subscriptions to support enterprise scenarios
  • Scale on Demand
    • Scale-out with Federations
      • Scale to virtually unlimited size to host very large databases across multiple servers
      • Better support for multi-tenant applications with numerous tenants
    • Scale-up and Scale-down Databases
      • Scale beyond 50GB and less than 1GB
    • Performance Predictability
      • Reserve compute capacity with Resource SLA
    • Enhanced multi-tenancy support
      • API level support for multiple DB server per subscription, provisioning & de-provisioning
  • Faster Innovation
    • Rich Insights with Reporting as a Service
      • Ability to author rich reports, host in Azure and view in on-premise or cloud apps
    • Spanning Apps with Sync Service
      • Synchronize data between SQL Azure DBs between SQL Azure & SQL Server
    • Rich Developer Experiences
      • Professional Devs: VS “Juneau”
      • Department Devs: LightSwitch
      • Java Devs: supported JDBC driver
      • International Devs: Localized Azure Portal
    • Data Market Enhancements
      • International rollout
      • Enhanced Content Management
      • Integration with Denali, Office and CRM

Resources

MIX11 - Session Review - Windows Azure Storage - Getting Started and Best Practices

Haridas (Software Developer Lead)

  • Windows Azure Storage
    • What is it?
      • Scalable, Durable, Highly Available Cloud Storage System
      • Pay for what you use
      • Abstractions
        • Blobs – Provides a simple interface for storing named files along with metadata for the file
        • Drives – Provides durable NTFS volumes for Windows Azure Applications to use – based on Page Blobs
        • Tables – Provides structured storage. A Table is a set of entities which contains a set of properties
        • Queues – Provides reliable storage and delivery of messages for an Application
    • Data Storage Concepts
      • Based on the Account
        • Container for Blobs (Blob Storage)
          • https://<account>.blob.windows.net/<container>
        • Table for Entities (Table Storage)
          • https://<account>.table.windows.net/<table>
        • Queue for Messages (Queue Storage)
          • https://<account>.queue.windows.net/<queue>
    • Blobs
      • Provides a highly scalable, durable and available file system in the cloud
      • An account can create many containers
        • No limit on number of blobs in a container
        • Limit of 100TB per account
      • Associate metadata with Blobs
      • Upload / Download Blobs
        • Allows range reads
        • Conditional operations – If-Match, Id-Not-Modified-Since, …
        • Sharing – Public containers, Shared Access Signatures (SAS)
          • SAS – pre-authenticated url
      • Storage client uses by default a timeout of 90 seconds. This can be changed using the BlobRequestOptions class to set the timeout to be according to the type of blob you’re uploading
      • Types of Blobs
        • Block Blobs
          • Targeted at streaming workloads
          • Each Blob consists of a sequence of blocks
            • 2 phase commit: Blocks are uploaded and them separately committed
            • Efficient continuation and retry
            • Send multiple out of order blocks in parallel and decide the block order during commit
            • Random range reads possible
          • Size limit is 200GB per blob
          • What to do?
            1. File has variable sized blocks
            2. Upload blocks in Parallel using PutBlock
            3. Retry failed blocks
            4. Commit blob using PutBlockList
        • Page Blobs
          • Targeted at random write workloads
          • Each blob consist of an array of pages
          • Size limit 1TB per blob
          • Page
            • Each page range write is committed on PUT
            • Page is 512 byte in size
            • Write boundary aligned at multiple of 512 byte
            • Range reads possible
            • Pages that do not have data are zeroed out
          • How?
            1. Write 5K bytes – PutPage
            2. Clear starting at a particular offset – ClearPage
            3. Overwrite bytes – PutPage
            4. Truncate Blob – SetMaxBlobSize
      • Sharing
        • Every blob request must be signed with the account owner’s key
        • Share your files options
          • The container must be public – read-only rights whenever you make a container public
          • Shared Access Signatures (SAS) – share pre-authenticated URLs with users
            • You decided who you’d like to share it with
            • You can give variable permition
              • Delete Blob
              • Write Blob
              • Read or Listing Blob
            • Two ways to do that
              • Everything embedded using the URL and doing that signing it with your owner key
              • Create an access policy that will contain all the parameters that normally are in the url
                • Advantage is that this will make it possible to change the policy after giving the URL so someone.
        • SAS
          • Use container level access as it allows access to be easily revoked
      • Snapshots
        • Point in time read-only copy of blob
        • Every snapshot creates a new read only point in time copy
        • Charged only for unique blocks or pages (ex. reuse blocks or pages)
          • For reuse, use WritePages or PutBlock & PutBlock
        • Restore snapshots using copy blob
        • Remember to cleanup your snapshots
      • Best Practices
        • Use parallel blocks upload count to reduce latency when uploading photo
        • Client Library uses a default of 90 seconds timeout – use size based timeout
        • Snapshots – For block or page reuse, issue block and page uploads in place of UploadXXX methods in Storage Client
        • Shared Access Signatures
          • Use container level policy as it allows revoking permissions
          • Share SAS Url using Https
        • Create new container for blobs like log files that have retention period
          • Delete logs after 1 month – create new containers every month
        • Container recreation
          • Garbage Collection can take time until which time container with same name cannot be created (this might make that you cannot create a new container immediately with exactly the same name after deleting the previous one)
          • Use unique names for containers
    • Drive
      • Provides a durable NTFS volume for Windows Azure Applications
        • Use existing NTFS APIs
        • Easy migration path to the cloud
        • Durability and survival of data on application failover or hardware failure
          • All flushed and un-buffered writes to drive are made durable
      • A Windows Azure Drive is a Page Blob
        • Mounts Page Blob as an NTFS drive
        • Mounted by one VM at a time for read/write
        • A VM can dynamically mount up to 16 drives
        • Drives can be up to 1TB
    • Tables
      • Provides Structured Storage
        • Massively Scalable and Durable Tables
          • Billions of entities (rows) and TBs of data
          • A storage account can contain many tables
          • No limit on number of entities (aka rows) in each table
          • Provides flexible schema
        • Familiar and Easy to use API
          • WCF Data Services – .NET classes and LINQ
          • REST (OData Protocol) – with any platform and language
      • Best Practices
        • Use the context.SaveChangesWithRetries(SaveChangesOptions.Batch)
          • SaveChangesOptions.Batch gives you transactional semantics to the operation
          • Transactions on entities are only allowed if the partition key is the same
        • CloudTableQuery<> handles ContinuationToken
        • Use clustered index in queries for performance (PartitionKey)
        • Limit large scans and expect continuation tokens for queries that scan
          • Split “OR” on keys as individual queries
        • Entity Group Transactions – Batch to reduce costs and get transaction
        • Do not reuse DataServiceContext across multiple logical operations
        • Discard DataServiceContext on failures
        • AddObject/AttachTo can Throw exceptions if entity is already being tracked
        • Point query throws an exception if resource does not exist. Use IgnoreResourceNotFoundException property
    • Queue
      • Queue are highly scalable, available and provide reliable message delivery
        • Simple, asynchronous work dispatch
        • A storage account can create any number of queues
        • 8K message size limit and default expiry of 7 days
        • Programming semantics ensures that a message can be processed at least once
          1. Get message to make the message invisible
          2. Delete message to remove the message
      • Access is provided via REST
      • Best Practices
        • Make message processing idempotent
        • Do not rely on order – invisibility time can result in out of order
        • Messages > 8K => use blobs or tables to store and message contains the blob or table entity key
        • Use message count to dynamically increase/decrease workers. Example:
          • Retain one instance that polls once every X time period
          • One instance polling every second result in 2.678.400 calls which cost around $2.67
          • Spawn more instances when you detect backlog
        • Use dequeue count to detect
          • Visibility expiry time needs to increase
          • Poison messages
  • Partitioning & Scalability
    • Know the scalability Targets
      • Single Blob Partition
        • Throughput up to 60 MB/s
      • Single Queue/Table Partition
        • up to 500 transactions (entities or messages) per second
      • Storage account
        • SLA – 99,9% availability
        • Capacity – Up to 100 TBs
        • Transactions – Up to 5000 entities per second
        • Bandwidth – Up to 3 gigabits per second
      • Scale above the limits
        • Partition between multiple storage accounts and partitions
        • When limit is hit, app may see ‘503 server busy’. Apps should implement exponential back-off
    • Storage Partition – How to Scale?
      • Every data object has a partition key
        • Different for each data type (blobs, tables, queues)
      • Partition Key is unit of scale
        • A partition can be served by a single server
        • System load balances partitions based on traffic
        • Controls entity locality
      • Systems load balances
        • Load balancing can take a few minutes to kick in
        • Can take a couple of seconds for partition to be available on a different server
      • Server busy
        • Use exponential back-off on “Server Busy”
        • Our system load balances to meet your traffic needs
        • Single partition limits have been reached
    • Automatic Load Balancing
      • Assignment
        • Process:
          1. When a request is made the Load Balancer delivers it to one of the Front-Ends and it’s delivered to the appropriate Back-Ends that is serving that partition
            • Each server has multiple partitions and the loads can be different
          2. If the Master System recognizes that a single service has to many request, then it will offload those partitions and reassign then to the systems that have less load
    • Partition Keys in each abstraction
      • Blobs
        • “Container Name + Blob Name” is the partition key
        • Every blob and its snapshot are in a single partition
      • Tables
        • “Table Name” + Partition Key is the partition
        • Entities with same partition key value are served from the same partition
      • Queues
        • Queue Name is the Partition Key
        • All messages for a single queue belong to the same partition

 

  • Interesting Tools to understand what’s happening with the Storage
    • Fiddler
    • Wireshark
    • NetMon

 

MIX11 - Session Review - What’s New in the Windows Azure Platform

James Conard (Sr. Director – @jamescon)

What is the Windows Azure Platform?

  • Provide the best and most comprehensive Platform as a Service offering for building, deploying, and running cloud applications
  • Open & Flexible
    • Using several technologies and not only the .NET Framework
  • Leverage Existing Investments
    • Use the known technologies and ways to develop that exist already in the market in order to reduce the difficulty of entering in the cloud
  • Ready for next Generation apps
    • Prepare for the next types of apps like mobile, and high available

Windows Azure Core Services

  • Compute
    • Scalable environment for running code
    • Enables .NET, C++, PHP, Ruby, Python
      • By default .NET Framework is installed but you can deploy the technology you’d like and use it
    • Automate Service Management
      • Abstract you from managing the infrastructure where your apps is running on
  • Storage
    • Scalable and highly available cloud storage
    • Blobs, Tables, Queues, Drives
    • REST APIs and several client libraries
  • Database
    • SQL Relational Database (SQL Azure)
      • Use the same knowledge that exist in using SQL Server and make them available in the cloud
    • Familiar programming model & Tools

Windows Azure Platform Roadmap

  • October 2008
    • Announced the Windows Azure Platform
    • First CTP of Windows Azure Platform
  • March 2009
    • Announced SQL Azure Relational DB
  • November 2009
    • Updates Windows Azure CTP
    • Announced VMRole, Project Sydney and Windows Azure Platform pricing and SLAs
    • Enable FullTrust & PHP, Java etc.
    • Project Dallas CTP
  • February 2010
    • Windows Azure Platform generally available
  • June 2010
    • Windows Azure Update
      • .NET Framework 4
      • OS versioning
    • SQL Azure Update
      • 50 GB databases
      • Spatial data Support
      • DAC support
  • November 2010 – Big Release
    • New Windows Azure Platform Management Portal
    • Multiple Service Administrators (co-Admins)
    • Remote Desktop
    • Full IIS
      • Web Roles previously using Hosted Web Core
        • Only supported a single HTTP or HTTPs endpoing
      • Web Roles now supporting Full IIS 7.0/7.5
      • Enables new scenarios
        • Multiple IIS websites
        • Multiple virtual machines
        • Configure IIS extensions
        • Web Deploy for Rapid development
    • Windows Server 2008 R2 & IIS 7.5
    • Elevated Privileges
    • Windows Azure Connect (CTP)
    • Windows Azure Virtual Machine Role (Beta)
    • Extra Small Instances
    • Startup Tasks & Admin Mode
      • Enables short, unattended setups on role startup
      • Silent MSIs, COM components, Registry Keys, Configuring Windows Server Roles, etc
      • Configuration Sample for startup tasks in the ServiceConfiguration.cscfg
        • <WebRole name=”test”>
          • <Startup>
            • <Task commandline=”<commandToBeRunned>” executingContext=”limited|elevated” taskType=”simple|foreground|background”/>
          • </Startup>
        • </WebRole>

Windows Azure Content Delivery Network (CDN)

  • Enabled from Windows Azure Platform Portal
  • Integrated with Storage (Blob Storage)
  • Recent Enhancements
    • Delivery from Windows Azure Compute instances
    • Https support
  • CTP of Smooth Streaming – End of April 2011

Windows Azure AppFabric Access Control Service v 2.0 (ACS)

  • Provides AuthN support using multiple identity providers
    • Easily integrate Live ID, Facebook, Yahoo, Google and Active Directory
    • Support for WS-Federation, WS-Trust, OpenID 2.0, OAuth 2.0
  • Familiar & Consistent .NET Programming Model
    • Use existing Windows Identity Foundations SDK & Assemblies
  • REST-based Service Management API
    • Integrate into your existing apps and control panels
  • Now Available
    • No charge during promotion period ending January 1st, 2012
    • Low cost after the promotion: $1.99 per 100.000 transactions

Windows Azure AppFabric Caching

  • Distributed in-memory cache for Windows Azure apps
    • Integrated directly with the cache using .NET client library
    • Session State Provider for Windows Azure applications
  • Caching provided as a building block service
    1. Configure an AppFabric Namespace
    2. Choose your cache size
    3. Write code against that service
  • Familiar & Consistent APIs
    • Same APIs as Windows Service AppFabric
  • Available commercially by the end of April
  • In the CTP only the Data Center of South Central US has the Caching Service
    • supported cache sizes: 128 MB, 256MB
  • After the end of April (commercial Availability) you’ll have it available in every data center with supported cache sizes from 128MB to 4GB

Cloud Data Services

  • SQL Azure Reporting (Currently in a Private CTP)
    • SQL Server Reporting provided as a Service
    • Reports authored using existing tools (BIDS) and deployed to SQL Azure Reporting
  • SQL Azure Data Sync
    • Data synchronization provided as a Service
    • Sync to/from SQL Azure Database
    • Sync between SQL Server and SQL Azure
  • Windows Azure DataMarket
    • Information marketplace for ISVs and IWs that provide trusted public domain & premium commercial data
    • Now commercially available
    • Firstly announced as codename “Dallas”

Performance Matters

  • The new Windows Azure Traffic Manager solved this problem
  • Load Balancing across multiple Hosted Services
  • Now Available in CTP
  • Three scenarios that are currently in the CTP
    • Performance
      • Directs the user to the best / closest deployment
    • Fault Tolerance
      • Redirect Traffic to another deployment based on availability
    • Round Robin
      • Traffic routed to deployments based on a fixed ration
  • Also allow to keep a status of all your apps in order to understand how to rout the traffic

Windows Azure Platform Access

  • Windows Azure Pass
    • Free 30-Day access to the platform
    • Includes:
      • Compute: 3 small instances
      • Storage: 3 GB + 250K transactions
      • Data Transfer: 3GB in & 3GB out
      • Database: 2x1GB Web Edition
    • Signup: http://windowsazurepass.com
    • Enter code: MIXABC
  • Introductory Trial
    • Available through September 30th, 2011
    • Includes:
      • Compute: 750 extra small hours + 25 small
      • Storage: 20GB + 50K transactions
      • Data Transfer: 20GB in & 20 GB out
      • Database: 1 GB Web Edition (90 Days)
    • Sign-up: http://windowsazure.com
    • Note: Requires Credit Card Information but allows you to access CTP services
  • Ultimate
    • Compute: 1.500 hours of small instances
    • Storage: 30 GB
    • Transactions: 2M
    • Bandwidth: 35 GB in / 35 GB out
    • Databases: 5 GB Web Edition
  • Premium
    • Compute: 1.500 hours of extra-small instances
    • Storage: 25 GB
    • Transactions: 1M
    • Bandwidth: 30 GB in / 30 GB out
    • Databases: 1 GB Web Edition
  • Professional
    • Compute: 750 hours of extra-small instances
    • Storage: 20 GB
    • Transactions: 250K
    • Bandwidth: 25 GB in / 25 GB out
    • Databases: 1 GB Web Edition

Resources

Interesting topics

  • You can select which OSFamily you want to use by editing the ServiceConfiguration.cscfg file with the values:
    • 1 – Windows Server 2008
    • 2 – Windows Server 2008 R2
  • Currently ASP.NET MVC 3 isn’t available on Windows Azure and so you need to install it using a Startup Task
  • Release of some Extensions for ACS 2.0 that allow ACS to be plugged directly in Umbraco allowing it to configured without going to the Management Portal
MIX11 - Session Review - HTML5 for Silverlight Developers

Giorgio Sardo (Senior Technical Evangelist)

What is HTML5?

  • Currently Working Draft
  • Microsoft believes that HTML5 is ready to go “Last Call” (Feature Complete) and early May 2011
    • This isn’t everything that has been talked about as being HTML5 since several different specs related to HTML5 are being worked on and in different stages

Developer Web Platform

  • Silverlight
    • XAML
    • Managed Languages
    • .NET APIs
  • Browser
    • HTML
    • SVG
    • CSS
    • Javascript
    • Web Apps
    • Note: For Microsoft, Silverlight shouldn’t compete with HTML5, but really being an extension for HTML5, since it does things that are currently not possible in HTML6.
  • Client Side Frameworks
    • jQuery
    • Modernizr
    • RxJs

Comparing some elements between HTML5 and Silverlight

    HTML5

    Silverlight

    Doctype App Manifest
    SVG XAML Graphics
    SVG Styles Resource Dictionaries
    Canvas Canvas/WritableBitmap
    Audio & Video Audio & Video
    CSS3 Grid, Flexbox Layout Controls
    CSS3 WOFF Typography
    CSS3 Transforms Transforms
    DOM OO and Event Model
    Timer DispatcherTimer
    Ecma Script 5 Managed Languages
    XDomainRequest Crossdomainpolicy.xml
    Web Storage Isolated Storage
    windowPerformance Profiling

Tools

  • Visual Studio 2010 SP1
  • Microsoft Expression
    • Microsoft Expression Design
    • Microsoft Expression Web
    • Microsoft Expression Encoder
    • Microsoft Expression Super Preview
  • AI->Canvas
  • AI
  • Inkscape

 

HTML5 DOC Type

  • Similar purpose to the AppManifest in Silveright

SVG

  • SVG Stands for Scalable Vector Graphics, an XML grammar for stylable grafics, usable as an XML namespace
  • Hosted as inline HTML, image, frame
  • Similar to XAML

SVG Graphics

  • Shapes: ‘path’, ‘rect’, ‘circle’, ‘ellipse’, ‘line’, ‘polyline’ and ‘polygon’
  • Text
  • Solid Colors, Linear and Radial Gradients, Pattterns
  • Raster Images
  • As in XAML you can use ViewBox

SVG Resources

  • ‘defs’ – defines the resources / ‘use’ – uses the resource
    • in XAML you can apply resource to just one scope and in SVG defs are accessible to all, like a Page Resource in XAML
  • ‘g’ – groups ‘defs’
  • CSS styling
    • you can use CSS rules to style SVG
  • Everything you draw in SVG as action and events
  • It doesn’t exist any Visual State Manager

HTML5 <Canvas>

  • HTML5 <canvas> != Silverlight canvas
  • Gives your Pixel Manipulation
  • the content of the <canvas> is the fallback that will appear in case of the browser no supporting that element

HTML5 <audio> & <video>

  • Suggested codec: MPEG-4 (H.264), MP3
  • Composite with HTML content
  • Not supported
    • Full screen
    • Smooth Streaming
    • DRM

CSS3 Layout

  • Silverlight Border = CSS3 Border
  • Silverlight Canvas = absolute positioning
  • Silverlight Grid = CSS3 Grid (submitted by Microsoft to W3C)
  • Silverlight Stackpanel: CSS3 Flexbox
  • Silverlight ViewBox: SVG ViewBox

CSS3 WOFF

  • Typography
  • @font-face (submitted by Microsoft and Mozilla to W3C)

Javascript and DOM

  • “Classic” Javascript
  • APIs exposed by the DOM:
    • DOM core
    • DOM Events
    • DOM HTML
    • DOM Style
    • … (around 20)
  • ECMA Script 5 simplifies the development
  • Frameworks
    • jQuery, …

Animations

  • setTimer() and setInterval() are your best friend
  • Be carefull since in Web you have only 1 thread

Cross Domain Requests

  • In Silverlight we have the crossdomainpolicy.xml
  • In HTML5 it uses Headers (origin) using XDomainAddress

HTML5 Web Storage

  • Similar to Silverlight Isolated Storage
  • Local or Session Storage
  • Based on Key/Value pairs
  • Limit 5MB per domain
  • Currently you can’t increase the limit

Profiling

  • windows.Performance.timing.ToJSON() – Proposed by Microsoft and currently a standard

Frameworks

  • jQuery
  • Modernizr
  • Raphael
  • RxJs
  • Script#
  • MVVM for JS (????)

More to come …

  • Network: HTML5 Web Sockets
  • Database: HTML5 IndexedDB
  • Devices: HTML5 Media Capture APIs

Resources

MIX11 - Session Review - Silverlight Performance Tips

Michael Cook ( Developer on Silverlight Performance )

  • Ideology
    • Develop a performance culture in your group
      • Test throughout your product cycle
      • Automate your performance Tests
      • Use your customer’s target hardware
    • Performance is a feature, treat it like one!
      • Spec
      • Schedule
      • Sign-off
  • Profiling with Visual Studio 2010
    • Sampled profiling (Available for Silverlight in the SP1 of VS2010)
      • Collects statistics about program execution
        • Identifies execution bottlenecks
        • Low overhead
      • Available on VS2010 Premium and Professional
      • If you don’t have it just use the WIndows Performance Toolkit (XPerf) – Free
  • Using the “EnableRedrawRegions” flag
    • How?
      • SilverlightHost host= Application.Current.Host;
      • host.Settings.EnableRedrawRegions = true;
  • Analyzing memory usage
    • What is memory profiling?
      • Analysis of the working set of an application
      • Careful, the terminology is confusing
        • VMMap.chm is a good authority for defining memory related terms
    • What is working set?
      • represents the amount of committed virtual memory that is physical memory and owned by the process
      • Most developers only look at “private”
    • Getting Started
      • VMMap
        • Great tool for getting 30.000 ft view of what’s going on in your app memory footprint
    • Managed Memory
      • WinDbg + Son of Strike (SOS) extension
        • Debugger extension for WinDbg
        • Allow you to inspect the live managed heap in an application
      • Some commands for quick reference
        • !loadby sos coreclr
        • !dumpheap –stat
        • !dumpheap –type <typename>
        • !dumpheap –mt <metertag>
        • !gcroot <address>
        • !do <address>
      • Third-party Memory Profilers are also interesting
    • Native Memory
      • XPerf native heap analysis
        • HeapMonitor.cmd makes it easier (Silverlight Performance Blog)
        • HeapMonitor.cmd –p %pid%
  • General Tips & Tricks
    • Improve Startup
      • The cardinal rule
        • Do the absolute minimum required to display your main screen
      • Methods
        • Simplify your XAML
        • Load less data and/or load data asynchronously
        • Reduce your XAP download size
          • Time Heuer’s “Loading Dynamic XAPs and Assemblies”
        • Use a splash screen if needed
    • Improve runtime performance
      • Reduce the complexity of the visual tree
      • Update only what is necessary on the screen
        • Use “EnableRedrawRegions”
      • Avoid updating elements with effects applied (eg. Shader Effects)
      • Leverage GPU acceleration and cached composition
      • Use BackgroundWorker for long running operations

References

MIX11 - Session Review - Advanced Features in Silverlight 5

Nick Kramer (Senior Program Manager in the Silverlight Team) nkramer@microsoft.com

Agenda

  • Unrestricted File Access
    • In Silverlight 4 trusted Apps can access
      • Documents
      • Music
      • Pictures
      • Videos
    • Silverlight 5 Trusted Aps can access everything
      • Using Standard System.IO classes
  • Trusted Apps In-Browser
    • SL4: has OOB apps run in trusted with user consent
    • SL5: in-browser trusted apps with admin consent
      • Set permissions via group policy
      • No prompts or installs
      • familiar navigation model
      • can be part of a large HTML site
        Feature Sandboxed App Trusted SL4 App Trusted SL5 App
        Prompt-free No Yes Yes
        Cross domain networking No Yes Yes
        Full keyboard in fullscreen mode No Yes Yes
        COM No Yes Yes
        Unrestricted File Access No Special Folders only Yes
        P/Invoke No No Yes
        Run in-browser No No Yes
    • Creating a In-Browser Trusted App
      • Part 1 – Ask for Trust:
        • In the current Beta it’s just like SL4 trusted OOB
          • Set the OOB SecuritySettings ElevatedPermissions = “Required”
      • Part 2 – Sign your XAP
        • Sign your .xap
          • Same as for a trusted OOB
          • In Visual Studio or on command line
        • Note: if you run an in-browser trusted app in localhost you don’t need to sign your .xap file
  • Group Policy
    • Actually, only one permission – Trusted or not
    • Network admin specifies which publishers are trusted
      • Publishers identified by Authenticode certificate
      • Put certificate in client machine’s trust publisher store
      • Same as ClickOnce
    • Xaps are associated with publishers by Authenticode
    • The trust is not for a specific app but for a certificate, and so every sl5 app that is sign with the same certificate will be trusted
  • P/Invoke (Coming Soon) – Only on Windows
    • P/Invoke lets you call native code
    • COM (SL4) also lets you call native code
      • Anything you can do with COM can also be done with P/Invoke
        • Strongly Typed
        • No COM registration
      • P/Invoke is optimized for Win32 APIs & native C/C++ code
      • COM is optimized for COM Automation APIs, example Office
    • COM & P/Invoke are available on Windows to trusted apps
    • How to use it
      • Works exactly the same as in the .NET Framework
      • Part 1: Setting up the declaration
        • [DllImport(“kernel32.dll”)]
        • static extern int GetDriveType(string lpRootPathName);
      • Part 2: Using it
        • int type = GetDriveType(drive);
  • HTML Support (Coming Soon)
    • Use HTML inside Silverlight Apps
      • To reuse existing HTML/ASP.NET content
      • To integrate with outside websites
    • In SL4, only OOB’s got WebBrowser (based on the WebOC)
    • In SL5, in-browser WebBrowser support (based on WebOC/IE)
      • trying to extent that to browsers not WebOC
      • WebBrowser control
    • Currently with SL5 the WebBrowser control in-Browser runs only on IE
    • You also have the WebBrowser Brush that is not interactive but it will make it possible to use it as the brush for other controls
  • Multiple Windows (Coming Soon)
    • Works only in OOB
    • System.Windows.Window is now an instantiable class
      • Window w = new Windows();
      • w.Height=400;
      • w.Width=600;
      • w.Content = new MyUserControl();
      • w.Visibility = Visibility.Visible;
    • Window Titles and Positioning are now completely up to the developer, and not strict as it was in SL4
    • Sandboxed OOBs automatically have the domain name added to the window title as a security measure
  • 64-bit (Coming Soon)
    • 64-bit machines & apps becoming increasingly common
    • SL5 can run in 64-bit process
      • 64-bit browsers
      • Sidebar on 64-bit Windows
    • Why 64-bit is interesting
      • Because you don’t get to choose the browser
      • Because you’re native hosting in 64-bit process
      • Because you need a lot of address space (taking advantage of address space)
  • Pivot Viewer (Coming Soon)
    • Ships as part of the SL5 SDK
    • Dynamic client-based collections
    • XAML-based visuals
      • You can define your visuals instead of the Bitmap
      • You can define different visuals for different zoom levels
    • Customizability
      • Now we have access to the fonts, sizes, colors, and so on ..
    • It will have the same process for binding as the DataGrid (ItemsSource)

Silverlight still has size constraints, currently with 7 MB with the version 5.

Call to Action

MIX11 - Day Two Keynote - Kinect Part

Jess Sandquist (Senior Director)

  • Announcing: Kinect for Windows SDK –research.microsoft.com/kinectsdk
    • Available later this spring
Posted: Apr 14 2011, 01:34 AM by Nuno.Godinho | with no comments
Filed under: ,
MIX11 - Day Two Keynote - Silverlight Part

Scott Guthrie (Corporate Vice President)

In December Silverlight 5 was announced

New Features

  • Media
    • Hardware decode
    • Integrating with IE9 Hardware accelerated graphics
    • TrickPlay
    • Remote Control
  • Better Text Quality
  • New 3D Api
    • Uses the familiar XNA 3D APIs
  • 64 bits version
  • Projection
    • Project 2D Objects in 3D Space
  • Binding in Style Setters
  • Implicit Data Templates
  • DataBinding Debugging
    • Breakpoints inside XAML
  • The Source code for the Demo shown will be available in the near future.
  • Announcing: Silverlight 5 Beta, Visual Studio 2010 SP1 Tools for Silverlight 5, Microsoft Expression Blend 5
MIX11 - Day Two Keynote - Windows Phone 7 Part

Joe Belfiore (Corporate VP)

Passionate Community (#wp7dev)

www.youtube.com/windowsphone video done by Brandon Foy - @brandonfoy – brandonfoy.tv

Windows Phone 7

  • Updates
    • Why are the updates later then expected?
      • Problems with some vendor phones with some problems from the factory.
    • Who decides when an update can actually ship?
      • For open phones Microsoft ships updates directly
      • For Operator Phones they require the Operator Testing Process Approval

 

  • Current Nearly 12.000 apps in the MarketPlace currently

 

  • Future / Next Steps
    • Significant update in the fall. Codename Mango
    • Features in Mango for Developers
      • Opportunity
        • Areas that Microsoft is working on:
          • Ecosystem
          • Countries
          • Discoverability
        • What to expect?
          • Enable More Countries and more places
          • Scale of users
            • IDC & Gartner suggest that by 2015 Windows Phone will be the second largest ecosystem in the world
          • Creation and Commerce
            • Supporting 16 more languages
            • More Countries that you can create apps – from 30 to 38
            • Increase the number of countries that you can buy apps – from 16 to 35
          • What that the Experience and Discoverability will be made easier when looking for apps in the marketplace
            • Hunting for an installed app is hard
              • JumpLists in the app list like in the people/contacts
              • Search in the app list
              • Search on MarketPlace
                • More Metadata available
                • Separate pivots for each type of app
              • Buying Process
                • Pivot in the App information prior to buying
            • Multi-Tasking UI
            • Announcement: Search Extras
              • Helping integrating extra apps in the search experience
      • Capability
        • Areas Areas that Microsoft is working on:
          • Browser
          • Phone Integration
          • Multi-Tasking
        • Support for IE9 in the Windows Phone 7
        • Announcement: Background Audio is supported for Apps and HTML5
        • Announcement: Support for video H.264
        • Comparing Browsers in Phones in the Speed Reading sample:
          • iPhone 4 – 2 FPS (frames per second)
          • Windows Phone 7 – 26 FPS (frames per second)
          • Nexus S – 11 FPS (frames per second)
        • Phone Integration
          • User Experience Enhancements
            • Improvement in the Panorama and Pivot Control
            • Live Tiles Improvements
              • Animations
              • Ways to the developer updating the live tiles
          • Support for TCP/IP sockets
          • Built-in SQL Database
          • more launchers & choosers
          • Access to Contacts & Calendar
          • Sensors
            • Raw Camera Data
            • Compass
            • Gyro
          • Announcement: Skype for Windows Phone 7 will be available this fall
          • Announcement: Adding you own audio files and make done into ringtones
          • Announcement: Live Tiles with Deeplinking to your apps
          • Coding Sensors made easy
            • Announcing Motion Sensor API
          • Multi-Tasking
            • Fast App switching
            • Background Audio
            • File Download Service
            • Alarms
          • Announcement: Angry Birds coming to Windows Phone 7 in the 25th of May.
          • Announcement: Live Agents
            • To run code in background but having it battery efficient
          • Announcement: Developer Tools will be available Next Month
      • Dev Experience
        • Talking about it: Scott Guthrie (Corporate Vice President)
        • Event Better Tools
          • Microsoft Visual Studio 2010
            • New Capabilities for the Emulator
              • Controlling the accelerometer
              • Simulating Gestures
              • Simulating Location (GPS)
            • Announcement: New Profiling Support
              • Identity Hotspots and pinpoint them
              • Based on:
                • Execution Time
                • Memory
              • Provides helpful warnings for the part that is being analyzed
              • See the Call Stack
              • Analyze per frame basis
          • Microsoft Expression Blend
        • Microsoft Internal Windows Phone 7 Performance Optimizations in the Mango Release
          • Scrolling and Input
            • User input is done now on a background thread instead of the UI Thread
          • Image Decode
            • Done in a background Thread not blocking the UI Thread
          • Garbage Collection
          • Memory Usage
            • 25 to 30% memory improvement without any changes needed to be made to our apps
        • Capabilities
          • Database
            • Includes a Built-in Local SQL Database (SQL CE)
            • Support Linq
            • Built-in full ORM
          • Support for Network Sockets
            • Just the same code needed for Silverlight 4
          • Camera
            • Apps can now control directly the camera, having access to the RAW video
          • Graphics
            • You can now do apps that compose both XNA and Silverlight at the same time
          • More than 1.500 new APIs
MIX11 – Day One Keynote – Developer Platform Part

Scott Guthrie ( Corporate Vice President )

Shipped over the Last 12 months:

  • Visual Studio 2010
  • ASP.NET 4.0
  • ASP.NET MVC 3
  • WebMatrix & IIS Express
  • Razor Syntax

Launched the nuGet project

Contributed for Open Source projects like jQuery

ASP.NET MVC 3

  • Announced Today a Refresh for ASP.NET MVC 3 tools that include:
    • HTML 5
    • jQuery 1.5 + Modernizr
    • Entity Framework 4.1 (Shipping officially today)
      • Includes the CodeFirst capability
    • Scaffolding support in VS2010
    • Preinstalled nuGet Packages

WebMatrix

  • Popular WebMatrix Helpers
    • Facebook
    • PayPal
    • Twitter
    • TemplateMonster.com
    • WuFoo
    • polldaddy
    • bit.ly
    • UserVoice
    • get Satisfaction
    • Scribd
    • DISQUS
    • Foursquare
    • PlanCast
    • EventBrite
    • GroupOn
  • Web Application Ecosystem
    • Several OpenSource Web Applications

Orchard CMS

  • Built on ASP.NET MVC 3

Windows Azure

  • Focus on Apps not Infrastructure
  • Scale elastically
  • Pay only for the resources that you use
  • Announcements
    • v2 of Access Control Service
    • Caching
    • CDN
    • Traffic Manager

Niels Hartviq – Umbraco CMS

More Posts Next page »