locked
Workflow runtime service - service not starting RRS feed

  • Question

  • Hi,

     

    I've created a custom WorkflowRuntimeService, but the service does not start...

    The service however gets created (instanciated) the service is created. I've put some logging in the constructor to be able to find this out.

    The service does not start when running in debug env (visual studio), and when hosting on appfabric it also does not start.

     

    My OnStarted or the Start methods never get called.

    Does somebody has any idea why ?

     

    Thanks

     class ExtraService: WorkflowRuntimeService
      {
    
    
        private void WriteToFile(string msg) {
              System.IO.StreamWriter writer = new System.IO.StreamWriter(@"c:\temp\ExtraService.log",true);
              writer.Write(DateTime.Now + "\t");    
          writer.WriteLine(msg);
              writer.Close();
        }
    
        public ExtraService(WorkflowRuntime wfRuntime)
        {
          WriteToFile("ExtraService constructor");
          wfRuntime.WorkflowStarted += new EventHandler<WorkflowEventArgs>(Runtime_WorkflowStarted);
        }
    
        void Runtime_WorkflowStarted(object sender, WorkflowEventArgs e)
        {
          WriteToFile(string.Format("WorkflowRuntimeService - workflow {0} started", e.WorkflowInstance));
        }
        
        protected override void OnStarted()
        {
          base.OnStarted();
          WriteToFile("ExtraService started");
        }
    
        protected override void Start()
        {
          base.Start();
          WriteToFile("ExtraService started");
        }
      }
    

    And this is my web.config

    <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>

              <workflowRuntime>
                <commonParameters/>
                <services>
                  <add type="AppFabricDemo.ExtraService, AppFabricDemo"/>
                </services>
              </workflowRuntime>
             
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
      </system.serviceModel>

    Monday, February 7, 2011 9:25 AM

Answers

All replies