Hosting Quickstart Sample for Windows Workflow Foundation - IIS or NT Service

We just published a WF Hosting Quickstart sample today and it shows a common hosting model for building WF programs and running them in either of:

  • ASP.NET and IIS
  • Your NT Service
  • A Console Host

Okay the third is just a debugging convenience for the second. This sample provides a simple layer that means you don't have any changes to your workflows and your WF Runtime Services whether running on either the first of second type of host. You should think of using this project as a start for building your own hosting environment for Windows Workflow Foundation projects. This joins a collection of other examples of WF Hosting which are also available:

It works with either Visual Studio 2005 or Visual Studio 2008. If you're still on 2005 you will need the .NET Framework 3.0 add-ons for WF.

Here's a simple walkthrough, although the readme in the sample also walks through this.

  1. Open the ZIP file
  2. Open the whitepaper and review it
  3. Open the VSI from the ZIP file – This part requires Visual Studio to be installed. You'll get an error otherwise.
  4. The VSI will prompt to accept installation of the addins and for a simple license
  5. Once this is done start Visual Studio
  6. Create a new project
  7. Choose the Visual C# node

  1. Click okay to create the project
  2. I don't have SQL Server express so I had to attach to the provided sql database and change the web.config and app.config files. This is my new connection string.

    <connectionStrings>

        <add
name="ASPNETWFConnectionString"
connectionString="server=.\SQLEXPRESS;Database=aspnetwf;Integrated Security=True"
providerName="System.Data.SqlClient"/>

    </connectionStrings>

  1. Press F5 to run the web hosting project

  1. Set the WFWCFWindowsService project to the startup project and press F5 to run the NT Service hosted project. It runs as a console application by default to aid in debugging
  2. Right click and start the WCFClient project to connect to the NT Service.

  1. Continue to customise the code for your host requirements.

Comments

  • Anonymous
    November 19, 2007
    We just published a WF Hosting Quickstart sample today and it shows a common hosting model for building

  • Anonymous
    November 19, 2007
    We just published a WF Hosting Quickstart sample today and it shows a common hosting model for building

  • Anonymous
    November 19, 2007
    love this game

  • Anonymous
    November 26, 2007
    Hi Paul, Thanks for the quickstart - im hoping to be able to put it to good use but ive had a bit of hassle with it. When i right click on the Workflow library project i am not getting the option to add a workflow - there is nothing in the menu or the list of templates when doing the add new item. Also, there is no information or help with hosting compiled workflows. Any help appreciated! TIA

  • Anonymous
    December 16, 2007
    I would like to run workflow as nt service but I would like to run using visual studio 3.0 Could you give me any help

  • Anonymous
    December 17, 2007
    Hi Sergey, There is a sample for that published here: http://blogs.msdn.com/pandrew/archive/2007/11/19/hosting-quickstart-sample-for-windows-workflow-foundation-iis-or-nt-service.aspx Regards, Paul

  • Anonymous
    January 10, 2008
    Any way we can get these in VB?