Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Test projects not able to be analysed for tests
baguazhang
#1 Posted : Thursday, April 21, 2016 4:20:19 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/13/2015(UTC)
Posts: 3

Hi there,

I have recently upgraded to the latest build of NCrunch having had the my previous version working quite happily for months and all of a sudden my test projects will not load and show the tests. I have been through several phases of fully uninstalling, reinstalling, manual installation, checking settings etc but to no avail. The error I get in full is bellow, not sure what else you would need from me, let me know if there is anything i can give you to make tracking this problem down easier.

Thanks
Henry

An error occurred while analysing this project after it was built: System.IO.FileNotFoundException: Could not load file or assembly 'nunit.core.interfaces, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system cannot find the file specified.
File name: 'nunit.core.interfaces, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' ---> System.IO.FileNotFoundException: Could not load file or assembly 'nunit.core.interfaces, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system cannot find the file specified.
File name: 'nunit.core.interfaces, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' ---> System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2015\nunit.core.interfaces.DLL' or one of its dependencies. The system cannot find the file specified.
File name: 'file:///C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2015\nunit.core.interfaces.DLL'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, 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.Common.CustomAssemblyResolver.ResolveAssembly(ParsedAssemblyName parsedAssemblyName)
at nCrunch.Common.CustomAssemblyResolver.(Object , ResolveEventArgs )
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, 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.Common.CustomAssemblyResolver.ResolveAssembly(ParsedAssemblyName parsedAssemblyName)
at nCrunch.Common.CustomAssemblyResolver.(Object , ResolveEventArgs )
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)


at nCrunch.Module.NUnit.Integration.NUnitTestFramework.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, ComponentUniqueName testComponentUniqueName)
at nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, TestFrameworkDescription[] frameworks, ComponentUniqueName testComponentUniqueName)
Remco
#2 Posted : Thursday, April 21, 2016 11:17:42 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi Henry,

This looks to me like a corrupt install state.

Do you have an NUnit ncrunchmodule file sitting in your root NCrunch install directory?

I realise you've already uninstalled/reinstalled a few times, but something worth trying is making sure the install directory is completely deleted after an uninstall. Sometimes the uninstaller will leave files behind in this directory if they aren't part of the original install state.

Try the following:

1. Uninstall NCrunch using Windows programs/features
2. Browse to the NCrunch install path - C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Remco Software
3. Ensure this directory is completely deleted
4. Reinstall using the MSI
baguazhang
#3 Posted : Friday, April 22, 2016 12:02:27 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/13/2015(UTC)
Posts: 3

Hi Remco,

I have just retried the installation as you described, fully uninstalling using programs and features, removing the 'Remco Software' folder entirely from the extensions directory before reinstalling with the MSI and I'm afraid I still get the same error reported.

With regard to the NUnit ncrunchmodule file, I have both the 'nCrunch.Module.NUnit.crunchmodule' and 'nCrunch.Module.NUnit.dll' in the root folder 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2015' i assume these are the files you are referring to?

Sorry for the bad news, anything else I can try or send you to make things clearer?
Remco
#4 Posted : Friday, April 22, 2016 12:15:09 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi Henry,

It isn't clear to me why the MSI is installing these modules where it is. This would appear to be erroneous behaviour of the windows installer, or perhaps there is something else amiss.

ALL module files are expected to be inside a subdirectory 'Modules' inside the install path. In the case of NUnit, you should see:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2015\Modules\NUnit\nCrunch.Module.NUnit.crunchmodule
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2015\Modules\NUnit\nCrunch.Module.NUnit.dll
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2015\Modules\NUnit\nunit.core.dll
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2015\Modules\NUnit\nunit.core.interfaces.dll

The error you are being given is indicative of the nCrunch.Module.NUnit.dll not being co-located with the nunit binaries, which is certain to cause problems.

If you download the ZIP file from the download page, this should show the correct directory structure of the modules as they should exist in the NCrunch install directory. The contents of the ZIP file should be an exact match to the installed product.
baguazhang
#5 Posted : Wednesday, May 4, 2016 5:35:33 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/13/2015(UTC)
Posts: 3

Hi Remco,

Sorry for taking so long to get back to me, it turns out this might actually be something that is not an installation issue. I found that some projects would work perfectly on my visual studio instance with NCrucnh doing all the cool things I have come to expect it to do. Every time I went back into my main work project however I would start getting these issues. I figured I would go back to basics and start a solution from scratch which would exhibit this strange behavior and I seem to have been able to do just that.

It turns out that we use FSCheck in our project and as part of it's nugget install it creates an addin file containing the following:
/// <summary>
/// Required to make NUnit play nicely with FsCheck
/// </summary>
[NUnitAddin(Description = "FsCheck addin")]
public class FsCheckNunitAddin : IAddin
{
public bool Install(IExtensionHost host)
{
var tcBuilder = new FsCheckTestCaseBuilder();
host.GetExtensionPoint("TestCaseBuilders").Install(tcBuilder);
return true;
}
}

This is the file that seems to break the analysis. If I comment out the contents of the file it seem to run all our FSCheck tests correctly and as such I think I can probably get around this for now. Just wanted to post back in case anyone else was having the same pains and also to inform you that something seems to be a little screwy with the way these tests are now working. Looking at the history of the FSCheck files in our source control this must be caused a change that was introduced within NCrunch itself since the test has been running well on previous versions of NCrunch for a while (I'm afraid I'm not sure which build broke it).

If you would like a really simple sample app that displays the issue let me know I have one now :)

Thanks for your help
Henry
Remco
#6 Posted : Wednesday, May 4, 2016 10:20:08 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi Henry,

Sorry for having completely misunderstood this problem. I thought that you were experiencing it on startup with a module load failure, but taking another look, this looks like it may actually be an NUnit version clash.

NCrunch ships with NUnit 2.6.3. It's possible that FsCheck is using some kind of override to tie into 2.6.4, and this is causing the assembly resolution issue.

Inside the directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2015\Modules\NUnit' you'll find a couple of NUnit DLLs. While the IDE is closed, try replacing these with their 2.6.4 equivalents and see if this makes any difference.

I've just done a quick test myself with FsCheck under NUnit v2. I received quite a different error complaining about the extension point, which went away when I turned on the 'Copy Referenced assemblies to workspace' NCrunch project-level setting for the test project. It looks like the extension loading expects the FsCheck assemblies to be co-located with the output binaries in the workspace.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.068 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download