I just created a simple MsBuildTask with the appropriate NUnit (3.7) test project. (both .net 4.6.1)
When using the new Tuple I get a BadImageFormatException when ncrunch (Version 3.11.0.5) executes the test.
This also happens in Version 3.10.0.20.
[h]An error occurred while analysing this project after it was built: System.BadImageFormatException: Die Datei oder Assembly "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" oder eine Abhängigkeit davon wurde nicht gefunden. Verweisassemblys sollten nicht für die Ausführung geladen werden. Sie können nur in einem Ladekontext nur für die Reflektion geladen werden. (Ausnahme von HRESULT: 0x80131058)
Dateiname: "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" ---> System.BadImageFormatException: Die Datei oder Assembly "file:///C:\Users\lab\.nuget\packages\System.ValueTuple\4.4.0\ref\net461\System.ValueTuple.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Verweisassemblys sollten nicht für die Ausführung geladen werden. Sie können nur in einem Ladekontext nur für die Reflektion geladen werden. (Ausnahme von HRESULT: 0x80131058)
Dateiname: "file:///C:\Users\lab\.nuget\packages\System.ValueTuple\4.4.0\ref\net461\System.ValueTuple.dll" ---> System.BadImageFormatException: Es kann keine Verweisassembly für die Ausführung geladen werden.
bei System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
bei System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
bei System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
bei System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
bei System.Reflection.Assembly.LoadFrom(String assemblyFile)
bei nCrunch.Common.CustomAssemblyResolver.ResolveAssembly(ParsedAssemblyName parsedAssemblyName)
bei nCrunch.Common.CustomAssemblyResolver.(Object , ResolveEventArgs )
bei System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)[/h]
You can reproduce this by simply creating a .net 4.6.1 project that referenecs NUnit and ValueTuple by using the latter in code
For exapmle:
[Test]
public void SomeTest()
{
DoSomething(("1", "2"));
}
public void DoSomething((string value1, string value2) values)
{
}Any suggestions?
The ReSharper testrunner executes the tests without error.
Thanks in advance
Lars