Ok was a bunch of work, but now I have a simple example test project with only one little test and it produces the error:
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void MyTest()
{
var list = new List<int> { 5 };
CollectionAssert.Contains(list, 5);
}
}
}
The problem is the CollectionAssert from the Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll. If I remove this line from the test and reset NCrunch all is fine. But I think the problem is not especially the CollectionAssert. We are using the CollectionAssert only in one of hundred tests and when I remove the test from our main test project, the error remains because other classes of the Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll are used in other tests. The assembly is part of MS VS 2013 which is installed on both machines parallel to VS 2015 which we are using for our solution development.
I compared the assembly version of Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll on both machines, they are identically. I compared the IL dumps of the local and server NCrunch build, identically instead of the MVID. And I build the little test project on my local VS and on the server VS and compared the IL dump, also identically instead of MVID and image base.
Do you have any idea?