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:
- A simple human task based ASP.NET WF host
- Hosting WF workflows in BizTalk Server
- The Visual Studio 2008 project template for hosting in a Console Application
- Hosting examples in the SDK
- A hosting Hands on Lab in both C# and VB.NET
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.
- Open the ZIP file
- Open the whitepaper and review it
- Open the VSI from the ZIP file – This part requires Visual Studio to be installed. You'll get an error otherwise.
- The VSI will prompt to accept installation of the addins and for a simple license
- Once this is done start Visual Studio
- Create a new project
- Choose the Visual C# node
- Click okay to create the project
- 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>
- Press F5 to run the web hosting project
- 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
- Right click and start the WCFClient project to connect to the NT Service.
- 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 buildingAnonymous
November 19, 2007
We just published a WF Hosting Quickstart sample today and it shows a common hosting model for buildingAnonymous
November 19, 2007
love this gameAnonymous
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! TIAAnonymous
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 helpAnonymous
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, PaulAnonymous
January 10, 2008
Any way we can get these in VB?