Update 4.0.1 for Microsoft .NET Framework 4 Features

This topic applies to Windows Workflow Foundation 4 (WF4).

The Update 4.0.1 for Microsoft .NET Framework 4 is a platform update that is a set of new features that provides additional functionality for top customer requests and important scenarios. This topic provides installation and deployment instructions and an overview of the new features in the platform update.

Update 4.0.1 for Microsoft .NET Framework 4 Features

This platform update contains enhancements and new features for Windows Workflow Foundation (WF). These updates include support for state machines workflows, persistence support for SQL Azure, and compensation support for custom workflow hosts.

State Machine Workflows

The following new classes were added to support state machine workflows.

For more information on how to use the new state machine functionality in Update 4.0.1 for Microsoft .NET Framework 4, see Getting Started Tutorial: How to Create a State Machine Workflow and Windows Workflow Foundation (WF4) - Introduction to State Machine Hands On Lab.

SQL WF4 Instance Store (SWIS) on SQL Azure

With this platform update, Windows Workflow Foundation developers can use SqlWorkflowInstanceStore together with SQL Azure. For SQL Azure, this update changes the following:

  • The existing schema installation Sqlworkflowinstancestoreschema.sql script uses an unsupported allow_page_locks keyword. Because of the unsupported keyword, an installation of SQL Workflow Instance Store fails when you try to install SQL Workflow Instance Store to be used together with SQL Azure. This update removes the keyword in some conditions by using an updated script.

  • The retry mechanism of SQL Workflow Instance Store is not customized for SQL Azure. Therefore, the computer encounters some potential reliability issues if the network fails periodically or if the connection is lost. In order to handle this issue, this update contains the following features:

    • The behavior and configuration elements for a new public MaxConnectionRetries property are exposed in the SqlWorkflowInstanceStore class. Users can configure the max number of reconnection attempts for SQL connections that are based on the network characteristics. The default value is three retries at a 1-second interval in order to stay consistent with the .NET Framework 4 for typical SQL Server deployments. We recommend that you set the values in the configuration or code to a value that is larger than 15 for SQL Azure.

    • The following new set of error codes are added to the retry logic in SQL Workflow Instance Store. These error codes are specific to SQL Azure scenarios.

      Error Code Error Message

      40197

      The service has encountered an error processing your request. Please try again.

      40501

      The service is currently busy. Retry the request after 10 seconds.

      10053

      A transport-level error has occurred when receiving results from the server. An established connection was aborted by the software in your host machine.

      40613

      Database database name on server server name is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of session tracing ID.

      20

      The instance of SQL Server you attempted to connect to does not support encryption.

Enable Custom Workflow Hosts to use WF4 Compensation

This platform update introduced new activities to model compensation behavior in WF4. In order to make a long-running process, these activities rely on the CompensationExtension extension that can be used from our primary WorkflowServiceHost host to save and reload the necessary state from persistent storage. This feature can be used by a customer who is interested in introducing a new workflow host that requires compensation.

Deploying Update 4.0.1 for Microsoft .NET Framework 4

The Update 4.0.1 for Microsoft .NET Framework 4 consists of three packages:

To configure Update 4.0.1 for Microsoft .NET Framework 4 on computers with Visual Studio 2010 SP1 that are going to be used to develop applications that target the functionality in the platform update, install Microsoft .NET Framework 4 Platform Update 1 – Design-time Package for Visual Studio 2010 SP1 (KB2495593).

Note

Note: Microsoft Visual Studio 2010 Service Pack 1 is required to install the Design-time Package for Visual Studio 2010 SP1 (KB2495593)

To configure a computer on which applications that target the Update 4.0.1 for Microsoft .NET Framework 4 are to be deployed, deploy Microsoft .NET Framework 4 Platform Update 1 (KB2478063) and the appropriate version of the .NET Framework 4.

Developing Workflow Applications using Update 4.0.1 for Microsoft .NET Framework 4 Functionality

To develop workflow applications in Visual Studio 2010 SP1 that target the new Update 4.0.1 for Microsoft .NET Framework 4 functionality, the Update 4.0.1 for Microsoft .NET Framework 4 – Design-time Package for Visual Studio 2010 SP1 (KB2495593) must be installed. Once it is installed, the .NET Framework 4 Platform Update 1 (KB2478063) profile can be chosen when creating a new .NET application.

New Project

There are two new profiles added to Visual Studio when the Design-time Package for Visual Studio 2010 SP1 (KB2495593) is installed.

  • .NET Framework 4 Platform Update 1 (KB2478063)

  • .NET Framework 4 Client Profile Platform Update 1 (KB2478063)

When a new project is created with the platform update profile selected, the .NET Framework 4 Client Profile Platform Update 1 (KB2478063) is used. The .NET Framework 4 Platform Update 1 (KB2478063) profile builds on the .NET Framework 4 profile, and the .NET Framework 4 Client Profile Platform Update 1 (KB2478063) profile builds on the .NET Framework 4 Client Profile. The .NET Framework 4 Client Profile is a subset of the .NET Framework 4 that is optimized for client applications. For more information, see .NET Framework Client Profile .

To choose either profile or change the profile after a project has been created, right-click the project in Solution Explorer, choose Properties, and select the desired profile from the Target framework drop-down.

Project Properties

When either of these profiles is selected, the features in the platform update are available and the State Machine activities are available in the Toolbox.

WF4 State Machine Activities

For more information on how to use the new state machine functionality in Update 4.0.1 for Microsoft .NET Framework 4, see Getting Started Tutorial: How to Create a State Machine Workflow and Windows Workflow Foundation (WF4) - Introduction to State Machine Hands On Lab.