title: How to (pre)start xamlx workflow service
body: <p>Related to <a href="https://stackoverflow.com/questions/2433670/wf4-workflow-versioning-using-workflowservicehost">this question</a>.</p>
  
  <p>I have a xamlx workflow service that loads part of its definition from a database when it runs (using <a href="http://msdn.microsoft.com/en-us/library/ee370926(VS.100).aspx" rel="nofollow noreferrer">ActivityXamlServices.Load</a>). Reason for this is that I need versioning, see the related question. I'll use WCF routing to direct calls to the right service.</p>
  
  <p>The part that I load dynamically contains a <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.activities.receive(VS.100).aspx" rel="nofollow noreferrer">Receive</a> activity. However, this activity is 'invisible' as long as the workflow doesn't start because the part of the workflow I load from the database is only loaded when the workflow starts. So from the outside it appears as if there is no <code>Receive</code> activity in the workflow.</p>
  
  <p>Apart from not being able to generate a contract for the workflow service, I can't call the service either. My first attempt was to do a soap call with the right contract on the workflow service. However, the runtime doesn't automagically activate my workflow in that case. So the question is, how do I start a workflow that is hosted inside IIS?</p>