asish's blog
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!
Introduction.
Windows Communication Foundation (WCF) is Microsoft's unified programming model for building service-oriented applications. It enables developers to build secure, reliable, transacted solutions that interoperate with applications in different platforms.
Interoperability is the fundamental characteristic of WCF. The fundamental communication mechanism is based on Web Services specifications such as SOAP, XML, XSD, WSDL and newly established standards including the WS-* protocols. These specifications address several areas, including basic messaging, security, reliability, transactions, and working with a service's metadata.
WCF relies on WS-Policy and WS-Metadata Exchange to discover information about the communications partners. Reliable communication is essential for most situations (no duplicates messages), and WS-Reliable Messaging would be used to interact with many of the other applications in this scenario. WS-Security and the related specifications might also be used for establishing a secure channel. The specifications support the main security services such as authentication, integrity and confidentiality. WS-Atomic Transaction is very important for managing transactional context involving several transactional resources.
The key point is that WCF implements interoperable Web services, complete with cross-platform security, reliability, transactions, and other services. It also is transport neutral, protocol neutral, and format neutral. For example, services are free to make use of HTTP, TCP, named pipes, and any other transport mechanisms for which there is an implementation. It is possible the WCF-to-WCF communication to be optimized, but all other communication uses standard Web services protocols.
The architecture.
The architecture is based on layers. See on Figure 1.

Figure 1.
This architecture permits programmers to work at several levels. High-level programming leverages the service runtime and doesn't require developers to directly work with messages at all, unless they want to. At the other end of the spectrum, developers can program to the messaging layer and take charge of communication activities.
Contracts
Contracts define various aspects of the message system. The data contract describes how every business object to be on the wire is going to be persisted using XML. The message contract defines specific message parts (header and body) using SOAP protocols, and allows finer-grained control over parts of the message. The service contract specifies the actual method signatures of the service. The policy and binding contracts enable you to specify transport, security details, and other aspects that must be met in order to communicate with a service.
Service Runtime
The service runtime manages the execution of services. It is possible to be specified the run-time behaviors through attributes or configuration settings. For example, a service can indicate that its instances are not thread-safe. Throttling behavior allows you to put limits on the number of connections, sessions, and threads. Error handling behaviors control how errors are handled and reported to clients. Metadata behavior governs how and whether metadata is made available to the outside world. Transaction behavior enables the rollback of transacted operations if a failure occurs. Dispatch behavior is the control of how a message is processed by the WCF infrastructure. Parameter filtering allows preset actions to occur based on filters acting on message headers.
Messaging
The messaging layer illustrates the possible formats and exchange patterns of the data. WS Security channel is an implementation of the WS-Security specification enabling security at the message layer. The WS Reliable Messaging channel enables the guarantee of message delivery. The encoders present a variety of encodings that can be used to suit the needs of the message. The HTTP channel specifies that the HyperText Transport Protocol is used for message delivery. The TCP channel similarly specifies the TCP protocol. The Transaction Flow channel governs transacted message patterns. The Named Pipe channel enables inter-process communication. The MSMQ channel enables interoperation with MSMQ applications.
Activation and Hosting
The specific method by which a service is started is determined by its activation options. And services can be either self-hosted or hosted in the context of another application. The Windows Activation Service (WAS) enables WCF applications to be activated automatically when deployed on a computer running the WAS. Services can also be manually run as executables (.EXE files). A service can also be run automatically as a Windows service. And a service can also be run as a COM+ application.
Services from the Outside.
From the outside, a service is collection of endpoints and a service description. The description is the information necessary for interchange messages with the service. It is used WSDL, XML Schemas, WS-Policy (description of non-functional requirements such as security mechanisms, schedules availability, and quality of service), WS-Metadata Exchange (WS-MEX) for asking the service to describe itself.
The endpoint is a basic unit of communication in Windows Communication Foundation (WCF). It is the physical port. You interchange messages with a service through the endpoints. Each endpoint is made up of three elements: an address, a binding, and a contract. The endpoint's ABC, A stands for address, B stands for binding and C stands for contract.
The address is basically a URI. The format of the address is scheme://myservice.mydomain.com:port/path. For example for accessing a service using http protocol you must write the following address down http://myservice.mydomain.com:8080/myservice/financialservice.svc, or for accessing a service using tcp protocol by the port 2525 you must write the following address down
net.tcp://myservice.mydomain.com:2525/myservice/financialservice.svc.
The binding describes how a service communicates with the partners. It is a collection of details such as transport method, encoding format, reliability requirements, and security requirements. WCF creates a channel stack to satisfy the using binding.
The contract is a collection of operations that specifies what the endpoint communicates to the outside world. Each operation is a simple message exchange, for example a request message and an associated reply message that form a request/reply message exchange.
Conclusion.
This paper is intended to present the fundamental concepts of Windows Communication Foundation as the new programming model for service-oriented development. WCF implements new specifications adopted in standardization organizations such as OASIS, W3C, etc. And it is a good object model that really represents the concepts of the Service-Oriented Architecture.