Sending and Handling Faults

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

This sample demonstrates how to use the SendReply and ReceiveReply messaging activities to send and receive expected and unexpected faults. In this scenario, the first client request results in an expected fault that has been included in its KnownTypes collection. The next few client requests result in receiving unexpected faults, before the final request succeeds.

To use this sample

  1. Open Visual Studio 2010 with elevated permissions, by right-clicking the Visual Studio 2010 icon and selecting Run as administrator.

  2. Open the Faults.sln solution file.

  3. To build the solution, press CTRL+SHIFT+B.

  4. Run the service project.

    1. In Solution Explorer, right-click the FaultService project and select Set as StartUp Project.

    2. Press CTRL+F5.

  5. Open another copy of Visual Studio 2010 with elevated permissions, by right-clicking the Visual Studio 2010 icon and selecting Run as administrator.

  6. Open the Faults.sln solution file.

  7. Run the client project.

    1. In Solution Explorer, right-click the FaultClient project and select Set as StartUp Project.

    2. Press CTRL+F5.

Dd807385.Important(en-us,VS.100).gif Note:
The samples may already be installed on your machine. Check for the following (default) directory before continuing.

<InstallDrive>:\WF_WCF_Samples

If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.

<InstallDrive>:\WF_WCF_Samples\WF\Basic\Services\Faults