Assembly output is "wrong"

Hi,

I am trying out TeamCity and I've set things up and I manage to build my solution from TeamCity. Now I want to run an MSpec test after the build and I've followed the instructions here http://blogs.jetbrains.com/dotnet/2010/12/coverage-with-dotcover-teamcity-mstest-nunit-or-mspec/.

However, I get a problem and I get the following error message:

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.

So what I did was this. I used TeamCity to build my solution. I then opened up a command prompt window to and tried to run the test from the command prompt window. However, I got the same error.

What I then did was to copy the problematic dll from my local machine to the build server and I ran the test manually from the command prompt and this time the test ran.

So I believe that for some reason, the assembly is not getting built properly. I've checked the full log files and I don't see any errors or warnings.

Is this a bug in TeamCity? Did I create the script wrong? The latter is 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="../Application.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\Application.Hosts.Web.Specs\bin\Application.Hosts.Web.Specs.dll --teamcity" />
    <Message Text="Running MSpec" Importance="high" />  
  </Target>
</Project>


TIA,

David

Please sign in to leave a comment.