What's New in .NET Framework 3.5 Service Pack 1
We are delighted to announce the release of .NET Framework 3.5 Service Pack 1! This update has
been more than a year in the making and, for WPF in particular, this servicing release includes
a significant number of the bug fixes, feature additions and enhancements that you have been
asking for. Today we’re also pleased to announce the release of the first CTP for our Controls
Toolkit which includes a new WPF datagrid.
We will be posting samples, videos and documentation for many of the improvements and feature
additions here on this site over the coming weeks. Here is a high level overview of the WPF
improvements in SP1 (some of this content is shamelessly ripped from Scott Guthrie’s
May 12th blog):
Application Startup and Working Set Performance Improvements
.NET 3.5 SP1 includes significant performance improvements to the CLR that enable much faster
application startup times - in particular with "cold start" scenarios (where no .NET application
is already running). Much of these gains were achieved by changing the layout of blocks within
CLR NGEN images, and by significantly optimizing disk IO access patterns. We also made some nice
optimizations to our JIT code generator that allow much better inlining of methods that utilize
structs.
While your mileage will vary, we are measuring 10-40% faster application startup improvements
for applications on SP1.
New .NET Framework Client Profile Preview Setup Package
.NET 3.5 SP1 introduces a new setup package option for developers building .NET client applications
called the ".NET Framework Client Profile Preview." This provides a new setup installer that enables a smaller,
faster, and simpler installation experience for .NET client applications on machines that do not already
have the .NET Framework installed.
The .NET Framework Client Profile Preview setup contains just those assemblies and files in the .NET Framework
that are typically used for client application scenarios. For example: it includes Windows Forms, WPF,
and WCF. It does not include ASP.NET and those libraries and components used primarily for server
scenarios. This setup package 28mb in size, and it can be downloaded and installed much quicker than
the full .NET Framework setup package (around 6 minutes for most users on a typical broadband
connection).
The assemblies and APIs in the .NET Framework Client setup package are 100% identical to those in the
full .NET Framework setup package (they are literally the same binaries). This means that applications
can target both the Client Profile Preview and full profile of .NET 3.5 SP1 (no recompilation required). All
.NET applications that work using the .NET Client Profile Preview setup automatically work with the full .NET
Framework.
A developer can indicate that the client application they are building supports both the .NET Framework
Client Profile Preview and the full .NET Framework by pulling up the project properties page for a client application
within VS 2008 SP1. Within the project properties page they can select a new checkbox that indicates it only
requires those assemblies included in the .NET Framework Client Profile Preview:
VS 2008 will then ensure that the project can only reference those assemblies shipped in the Client Profile Preview
setup package (and it will generate a compile error if you try and use a type in an assembly not included
in the client redist). The compiled client application will then run on machines that have both the full .NET
Framework installed, as well as machines that only have the .NET Framework Client Profile Preview installed.
If you have a machine that only has the .NET Framework Client Profile Preview installed, and you try and run a .NET
application on it that did not mark itself as supporting the .NET Framework Client Profile Preview, then the CLR will
refuse to run the application - and will instead prompt the end-user to upgrade to the full .NET Framework
package. This ensures that applications always run correctly - and that developers do not need to worry about
missing assembly exceptions at runtime if a user tries to run an application that requires the full .NET
Framework on a machine that only has the .NET Framework Client Profile Preview installed.
We believe that a large class of .NET client applications will be able to use this new .NET Client Profile Preview setup
to significantly speed up their installation, and enable a much more consumer friendly experience.
New .NET Framework Setup Bootstrapper for Client Applications
.NET 3.5 SP1 introduces a new "bootstrapper" component that you can use with client applications to help automate
making sure that the right version of the .NET Framework is installed.
The bootstrapper component can handle automatically downloading and installing either the .NET Framework Client
Profile or the full .NET Framework Setup Package from the Internet if your machine doesn't have either of them
installed. The boostrapper can also automatically handle upgrading machines that have a previous version of the
.NET Framework installed. For example, if your machine already has .NET 3.0 installed, and your application
requires .NET 3.5, the bootstrapper can optionally download just the update files needed to upgrade it to .NET 3.5
(and avoid having to download the full .NET Framework setup download).
The setup bootstrapper component can be used with both ClickOnce based setup packages, as well as with third party
installer products (like Installshield). The boostrapper optionally enables fully customized setup branding experiences
(splash screens, custom setup wizard steps, etc) and should make it much easier to build optimized client setup
experiences.
ClickOnce Client Application Deployment Improvements
.NET 3.5 SP1 includes several improvements for ClickOnce deployment of both Windows Forms and WPF applications.
Some of these improvements include:
- Support for the .NET Framework Client Profile Preview (all ClickOnce features are supported with it)
- ClickOnce applications can now be programmatically installed through a ‘Setup.exe’ while displaying a customized,
branded install UX
- ClickOnce improvements for generating MSI + ClickOnce application packages
- ClickOnce error dialog boxes now support links to application specific support sites on the Web
- ClickOnce now has design-time support for setting up file associations
- ClickOnce application publishers can now decide to opt out of signing and hashing the ClickOnce manifests as
they see appropriate for their scenarios.
- Enterprises can now choose to run only Clickonce Applications Authenticode signed by "Known Publishers" and
block anything else from running
- FireFox browser extension to support Clickonce installations using FireFox browsers
WPF Performance Improvements
.NET 3.5 SP1 includes several significant performance optimizations and improvements to WPF. Some of the specific
graphics improvements include:
- Smoother animations (with Vista SP1 and Windows XP SP3)
- Hardware accelerated rendering of Blur and DropShadow Bitmap Effects
- Text Rendering speed improvements - especially with VisualBrish and 3D scenes
- 2D graphics improvements - especially with z-index scenarios
- A new WriteableBitmap class that enables real-time and tear-free bitmap updates. This enables
custom "paint"-style applications, data visualizations, charts and graphs that optionally
bypass the default WPF 2D graphics APIs.
- Layered window performance improvements
SP1 also adds support for better data scalability in WPF. The ListView, ListBox and TreeView
controls now support "item container recycling" and "virtualization" support
which allows you to easily achieve a 40% performance improvement with scrolling scenarios.
These controls also now optionally support a "deferred scrolling" feature which allows you to
avoid scrolling in real time and instead wait until a user releases the scroll thumb (the default
scrolling mode in Outlook). This can be useful when scrolling over very large data sets quickly.
WPF Data Improvements
.NET 3.5 SP1 includes several data binding and editing improvements to WPF. These include:
- StringFormat support within {{ Binding }} expressions to enable easy formatting of bound values
- New alternating rows support within controls derived from ItemsControl, which makes it easier to set
alternating properties on rows (for example: alternating background colors)
- Better handling and conversion support for null values in editable controls
- Item-level validation that applies validation rules to an entire bound item
- MultiSelector support to handle multi-selection and bulk editing scenarios
- IEditableCollectionView support to interface data controls to data sources and enable
editing/adding/removing items in a transactional way
- Performance improvements when binding to IEnumerable data sources
WPF also now exposes hooks that enable developers to write custom panels w/ virtualized scrolling. We'll
be using this support together with the above data binding improvements to build the new WPF datagrid that
will be shipping later this year.
WPF Extensible Shader Effects
.NET 3.5 SP1 adds support in WPF for a new shader effects architecture and API that allows extremely
expressive visual effects to be created and applied to any control or element within WPF. These shader
effects support blending multiple input compositions together. What makes them particularly powerful is
that WPF executes effects (including custom effects you build yourself) using the GPU - giving you fully
hardware accelerated graphics performance. Like almost everything in WPF, you can also use WPF databinding
and animation on the properties of an effect (allowing them to be fully integrated into an experience).
Applying an effect onto a Control is super easy - just set a Control's "Effect" property. For example,
to add a hardware accelerated drop-shadow effect on a button you can use the built-in <DropShadowEffect>
on it via either code or XAML:

Which will cause the button to render like so:

Because Effects are extensible, developers can create their own custom Effect objects and apply them.
For example, a custom "DirectionalBlurEffect" could be created and added to a ListBox control to change
its scroll appearance to use a blur effect if you rapidly scroll across it:

Keep an eye on Greg Schechter's blog to learn
more about how the Effects architecture works and to
learn how you can both create and apply new effects within your applications
(his first set of posts are here).
Note: In addition to introducing the new Shader Effects API, WPF in SP1 also has updated the existing Blur
and DropShadow Bitmap effects already in WPF to be hardware accelerated.
WPF Interoperability with Direct3D
.NET 3.5 SP1 adds support to efficiently integrate Direct3D directly into WPF. This gives you more direct
access to the hardware and to take full advantage of the Direct3D API within WPF applications. You will
be able to treat Direct3D content just like an image within an application, as well as use Direct3D content
as textures on WPF controls.
For example, below are three samples from the Direct3D SDK:

We could either load them in as image surfaces within a WPF application, or map them as textures on WPF
controls. Below is an example of mapping them as textures onto cubes in a WPF 3D application:

VS 2008 for WPF Improvements
VS 2008 SP1 includes several significant improvements for WPF projects and the WPF designer. These include:
- Several performance improvements
- Events tab support within the property browser
- Ability to sort properties alphabetically in the property browser
- Margin snaplines which makes form layout much quicker
- Better designer support for TabControl, Expander, and Grid
- Code initiated refactoring now updates your XAML (including both control declarations and event declarations in XAML)
- Go to Definition and Find All References now support things declared in XAML
The debugger has also been updated in SP1 so that runtime errors in XAML markup (for example: referencing
styles, datasources and/or other objects that don't exist) will now be better identified within the
debugger:

WPF Toolkit CTP: DataGrid
The first drop of our new WPF DataGrid(which is built on 3.5 SP1) is available in the WPF Toolkit at the WPF Codeplex site.
Beyond this release, we are committed to continual and rapid improvement to WPF, the
.Net Framework and tools and we're not slowing down at all. We are already hard
at work on the next release (.Net 4.0, Visual Studio 10 and Expression 3). We'll
continue to focus on quality and performance improvements, new controls, graphics innovation
and improving the designer and tooling stories for WPF in both Visual Studio and Expression.
But we want to hear from you on your experience with this service pack and what you’d like to
see in the future - so please keep the comments and suggestions coming!