This is the error:
Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'nCrunch.TestRuntime, Version=1.48.0.5, Culture=neutral, PublicKeyToken=01d101bf6f3e0aea'. Perhaps it doesn't exist in the Mono for Android profile?
To reproduce:
- Create new sln with an Android application (AndroidApplication1, build successful)
- Enable NCrunch
- Add a new Android Class Library (AndroidClassLibrary1, build successful)
- From AndroidApplication1 add a reference to AndroidClassLibrary1 (build error above)
Additional:
- A simple msbuild in the ncrunch build directory has the same result.
- When I add a reference from an android class library to another class library there is no error.
- Other assemblies used by the android class library are not found either.
I guess I could try to add the binaries as 'additional files to include' but I don't think this is how it should work. I could work around it by ignoring the project, but how should it work?
So far NCrunch hasn't yet seen any official testing on the Xamarin platform - I cannot guarantee at this time that it will work correctly.
With that said though, this is quite a strange error message. The 'nCrunch.TestRuntime.DLL' file is installed into the GAC by the NCrunch installer. If Xamarin is unable to locate this assembly, this suggests that it is not using the standard CLR resolution logic for doing so.
If Xamarin is looking for this assembly, something that may work is to turn off the 'Instrument output assembly' configuration setting for the project. The reference to nCrunch.TestRuntime is introduced when NCrunch instruments the assembly. Does this get around the error?
The error is the same with 'instrument output assembly' turned off. The error does not seem to be specific to the nCrunch.TestRuntime assembly but shows for all assemblies referenced by the android class library.
Sorry - in that case this will probably need to be combined with the 'Copy referenced assemblies to workspace' setting, as the Xamarin build steps must be probing for dependencies adjacent to the build output file.
I'm not sure if there may be more issues hiding behind that. My assumption is that the Xamarin runtime environment is probably quite different to the standard CLR, so NCrunch's test runners may run into trouble.
I'm sorry that I'm of pretty limited help here. I'll need to perform more testing and fixes to NCrunch to allow it to work properly with this platform.
You may be right that Xamarin is not resolving from the GAC. When I add a reference to nCrunch.Runtime.dll to the project, NCrunch is able to build it successfully. It's a 9K workaround I'm happy with to get NCrunch working with Xamarin. Please let me know if you find a better solution.