This project is read-only.

sharpbits in service having erratic success on reboot

Aug 19, 2016 at 3:04 PM
I have sharpbits running in a service and it starts fine but on reboot there are issues depending on the state of BITS. If BITS is not running we often time out (1053 error). Here is the wix I use. Below is my OnStart method.

Ideas?
  <Component Id="CP_Updater.exe" Guid="mtguid" Directory="UpdaterDir">
    <File Id="FL_Updater.exe"
                          Name="Updater.exe"
                          Source="$(var.Binaries)\Updater.exe"
                          DiskId="1"
                          Vital="yes">
    </File>
    <ServiceInstall
      Id="ServiceInstaller"
      Type="ownProcess"
      Vital="yes"
      Name="Updater"
      DisplayName="Updater Service"
      Description="Updating Files"
      Start="auto"
      ErrorControl="normal"
      Arguments=" /start Updater">
      <ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall ="yes" />
      <ServiceDependency Id="BITS"/>
    </ServiceInstall>
    <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="Updater" Wait="yes" />
  </Component>

    protected override void OnStart ( string [ ] args )
    {
        //we needed to start quickly so service would resume post reboot.
        _thread = new System.Threading.Thread ( runService );
        _thread.IsBackground = true;
        _thread.Start ();
    }
Aug 19, 2016 at 7:37 PM
It was objects being allocated in the download class. I moved the allocation to a later point and the service started right up each test.