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

Notification

Icon
Error

Build Error with Xamarin.Android application
pauldendulk
#1 Posted : Monday, February 3, 2014 8:33:28 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/3/2014(UTC)
Posts: 2
Location: Netherlands

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?
Remco
#2 Posted : Monday, February 3, 2014 10:15:01 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this issue.

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?
pauldendulk
#3 Posted : Monday, February 3, 2014 11:56:45 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/3/2014(UTC)
Posts: 2
Location: Netherlands

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.

Remco
#4 Posted : Monday, February 3, 2014 11:23:41 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
leeparkinson
#5 Posted : Sunday, December 7, 2014 8:56:37 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/7/2014(UTC)
Posts: 1
Location: United Kingdom

Was thanked: 1 time(s) in 1 post(s)
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.
1 user thanked leeparkinson for this useful post.
GreenMoose on 5/29/2017(UTC)
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.058 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download