I am trying to run a MSpec test following the build of my solution. So, I've got my MSBuild script set up as follows:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Build">
<MSBuild Projects="../MyApplication.Web.sln" />
<Message Text="Building solution" Importance="high" />
</Target>
<Target Name="TeamCity" DependsOnTargets="Build">
<Message Text="Before executing MSpec command" Importance="high" />
<Exec Command="mspec.exe ..\Hosts\MyApplication.Hosts.Web.Specs\bin\MyApplication.Hosts.Web.Specs.dll --teamcity" />
<Message Text="Running MSpec" Importance="high" />
</Target>
</Project>
I then call "TeamCity" as my target in TeamCity. When the command
"mspec.exe ..\Hosts\MyApplication.Hosts.Web.Specs\bin\MyApplication.Hosts.Web.Specs.dll --teamcity"
is executed, I get the following error:
C:\TeamCity\buildAgent\work\117e3aa3bb76aad0\Build>mspec ..\Hosts\Application.Hos ts.Web.Specs\bin\Application.Hosts.Web.Specs.dll Could not load file or assembly 'file:///C:\TeamCity\buildAgent\work\117e3aa3bb7 6aad0\Hosts\Application.Hosts.Web.Specs\bin\Application.Hosts.Web.Specs.dll' or on e of its dependencies. An attempt was made to load a program with an incorrect f ormat.
After doing some investigation, I found out that the "MyApplication.Hosts.Web.Specs.dll" on my local machine and the build server, although both 15kb, had different md5 checksums. That might explain why the execution of the MSpec test would cause errors. In fact, if I copy the dll from my local machine to the build server, the test will run.
So my question is whether someone else has come across this same issue of the builiding of assemblies being build "badly"?
-EDIT- Locally I'm building the solution as a 64 bit application but in TeamCity, I'm building it as 32 bits (x86). Could that be the problem?
PS:I tried building it as a 64 bit application in TeamCity but I get other errors which I would rather ignore for the moment. However, for completeness sake here it is:
Client\ProdMaster.SLCharts\ProdMaster.SLCharts.csproj
[15:11:22]: [Client\ProdMaster.SLCharts\ProdMaster.SLCharts.csproj] GetFrameworkPaths
[15:11:22]: [GetFrameworkPaths] ValidateSilverlightFrameworkPaths
[15:11:22]: [ValidateSilverlightFrameworkPaths] C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.Common.targets(104, 9): The Silverlight 4 SDK is not installed.