We are in the process of moving from CuiseControl.NET and NAnt into TFSBuild. One of the .NET solutions I was prototyping kept giving me a generic error message when it tried to run the NUnit tests we have.
The message was…
Exception System.IO.FileLoadException, Exception thrown executing tests mytest.dll
Took me a few days but finally came across a post that got me thinking. Some of our references are fully signed. So that means the test which is unsigned is trying to call some signed assemblies to execute.
I first enabled verification skipping on the build machine (see the SN help for this). That worked and it was able to execute NUnit tests. But I don’t want that enabled on my build machine. Having that could result in files not getting signed and deployed. This would result in runtime errors in our environments.
The solution is to add a line similar to this on the MSBuild arguments (under Advanced) for your build definitions. It will look something like this:
/p:SignAssembly=true,DelaySign=false,AssemblyOriginatorKeyFile=..\..\Global\MyPrivateKey.snk
del.icio.us Tags:
TFS Tips,
TFS 2013