I'm trying to onboard some existing projects to NCrunch.
I have my product assemblies building in NCrunch fine, as does the test DLL. However, when it goes to run the tests, I hit this:
[14:31:54.361-TestExecutionTask-30] ERROR (Internal): System.IO.FileLoadException: Could not load file or assembly 'Company.Product.TDD.Tests, Version=4.0.0.0, Culture=neutral, PublicKeyToken=abcdefghijklmnop' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
File name: 'Company.Product.TDD.Tests, Version=4.0.0.0, Culture=neutral, PublicKeyToken=abcdefghijklmnop' ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)
The Zone of the assembly that failed was:
MyComputer
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at nCrunch.TestExecution.Frameworks.MSTest.MSTestFramework.InitialiseFrameworkForExecution(String solutionDirectory, String testAssemblyPath, Int32 defaultTimeout)
at nCrunch.TestExecution.RemoteTaskRunner.#=qZWpQ9Fw22coT4CYtVCQtBhy6_ObFkRjwoNz3BHL7LTQ=(Type #=q1APDvnYbnncAEGFyjNsjXDgNdldLD1p4qgqUZXeCdLc=)
at nCrunch.TestExecution.RemoteTaskRunner.RunTests(IMasterExecutionMap[] masterExecutionMaps, IList`1 testsToRun, Type testFrameworkType, Boolean considerInconclusiveTestsAsPassing)
I used fuslog to try and get a better look at the issue, but it doesn't really tell me anything useful. Also, I've used sn.exe to ensure that the PublicKeyToken that was used to delay sign the assemblies is being allowed.
In my NCrunch config, I have "Prevent signing of output assembly" set to false. Should I be setting this to true and doing something special maybe, as the troubleshooting section says? I'm not really sure what to do next.