Windows Service Installation

Hello, I’m having some trouble installing a windows service with Octopus. After a few mistakes on my part, I think I’ve gotten it to a point where it’s not me (I hope, anyway). I’ve successfully installed the service locally using InstallUtil.exe. I’ve also successfully gotten Octopus to install it back to my machine through a tentacle. I cannot get it to install to two other test machines (success machine is Win 7, failures are Win2008R2). They result in a BadImageFormatException.

Note that even though the installation knowingly fails, the dashboard reports it as a successful deployment.

Successful Installation Log (just to show it did work on one box):

2011-07-08 19:31:25 INFO   Deploying release '1.0.2' of project 'AwesomeService' into environment 'Development'
2011-07-08 19:31:25 INFO   Downloading NuGet package AwesomeService 1.0.2 from feed: '\\xxx\Files'
2011-07-08 19:31:25 DEBUG  Completed download of NuGet package AwesomeService 1.0.2
2011-07-08 19:31:25 DEBUG  Uploading package AwesomeService 1.0.2 to tentacle http://xxx:10933
2011-07-08 19:31:26 DEBUG  Package AwesomeService 1.0.2 has already been uploaded to tentacle 'http://xxx:10933', no need to upload it
2011-07-08 19:31:26 DEBUG  Deploying package AwesomeService 1.0.2 to tentacle http://xxx:10933
2011-07-08 19:31:29 INFO   Deployment successful. Tentacle output follows:
2011-07-08 19:31:26 DEBUG  Tasks will be run in the following order: 
 - PowerShellPreDeployScript
 - XmlConfigTransforms
 - XmlConfigVariables
 - PowerShellDeployScript
 - Installers
 - IisWebSite
 - PowerShellPostDeployScript
2011-07-08 19:31:26 INFO   Updating any .config files
2011-07-08 19:31:26 INFO   Installing any Installers
2011-07-08 19:31:26 DEBUG  Scanning assembly: C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe
2011-07-08 19:31:26 DEBUG  Running InstallUtil  /i "C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe"  /OctopusEnvironmentName="Development"
2011-07-08 19:31:28 DEBUG  InstallUtil 'C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe' completed.
2011-07-08 19:31:28 DEBUG  InstallUtil output:
2011-07-08 19:31:28 DEBUG  Microsoft (R) .NET Framework Installation utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe assembly's progress.
The file is located at C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.InstallLog.
Installing assembly 'C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe'.
Affected parameters are:
   logtoconsole = 
   i = 
   logfile = C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.InstallLog
   assemblypath = C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe
Installing service AwesomeService...
Service AwesomeService has been successfully installed.
Creating EventLog source AwesomeService in log Application...

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe assembly's progress.
The file is located at C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.InstallLog.
Committing assembly 'C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe'.
Affected parameters are:
   logtoconsole = 
   i = 
   logfile = C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.InstallLog
   assemblypath = C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe

The Commit phase completed successfully.

The transacted install has completed.

2011-07-08 19:31:28 DEBUG  A web.config file was not found, so no IIS configuration will be performed.
2011-07-08 19:31:28 INFO   Deployment complete!

Failure Message:

2011-07-08 19:35:34 INFO   Deploying release '1.0.2' of project 'AwesomeService' into environment 'Development'
2011-07-08 19:35:34 INFO   Downloading NuGet package AwesomeService 1.0.2 from feed: '\\xxx\Files'
2011-07-08 19:35:34 DEBUG  Completed download of NuGet package AwesomeService 1.0.2
2011-07-08 19:35:34 DEBUG  Uploading package AwesomeService 1.0.2 to tentacle http://yyy:10933
2011-07-08 19:35:35 DEBUG  Package AwesomeService 1.0.2 has already been uploaded to tentacle 'http://yyy:10933', no need to upload it
2011-07-08 19:35:35 DEBUG  Deploying package AwesomeService 1.0.2 to tentacle http://yyy:10933
2011-07-08 19:35:36 INFO   Deployment successful. Tentacle output follows:
2011-07-08 19:35:35 DEBUG  Tasks will be run in the following order: 
 - PowerShellPreDeployScript
 - XmlConfigTransforms
 - XmlConfigVariables
 - PowerShellDeployScript
 - Installers
 - IisWebSite
 - PowerShellPostDeployScript
2011-07-08 19:35:35 INFO   Updating any .config files
2011-07-08 19:35:35 INFO   Installing any Installers
2011-07-08 19:35:35 DEBUG  Scanning assembly: C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe
2011-07-08 19:35:35 DEBUG  Running InstallUtil  /i "C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe"  /OctopusEnvironmentName="Development"
2011-07-08 19:35:35 DEBUG  InstallUtil 'C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe' completed.
2011-07-08 19:35:35 DEBUG  InstallUtil output:
2011-07-08 19:35:35 DEBUG  Microsoft (R) .NET Framework Installation utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.

Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Octopus\Tentacle\Applications\AwesomeService.1.0.2\content\AwesomeService.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format..

2011-07-08 19:35:35 DEBUG  A web.config file was not found, so no IIS configuration will be performed.
2011-07-08 19:35:35 INFO   Deployment complete!