vendredi 30 janvier 2015

Using references in NUnit with Bamboo

I have a unit test (NUnit) which refers to a resource in a Visual Studio project. The test works correctly in Visual Studio, but when I try to run it with Bamboo, our build/CI server, this error occurs:


SetUp : System.BadImageFormatException : Could not load file or assembly 'IOHandlerLibrary, Version=1.0.5508.26943, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.


Bamboo is configured to run the DLL of the test project. It also has available in the same directory as the DLL the file which is being referenced by the resource.


Here is an example of how the resource is being accessed:



string superTruss = System.Text.Encoding.UTF8.GetString(IOHandlerUnitTests.Resource1.SuperTruss);

Aucun commentaire:

Enregistrer un commentaire