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

Notification

Icon
Error

Unit testing Xamarin Portable Project
Queck
#1 Posted : Sunday, June 28, 2015 11:42:47 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/13/2014(UTC)
Posts: 6
Location: Germany

Was thanked: 1 time(s) in 1 post(s)
Hi,

I am starting a new cross platfom project using Xamarin.Forms.
I am putting my shared code into a "Portable" Class library.
I am using xUnit for unit testing.
My first unit test - <class> can be created - works nice using ReSharper or MS-Test.

As I try to run the tests with NCrunch I get the following Build-Error-Message:
NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
..\packages\Xamarin.Forms.1.4.3.6358-pre2\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets (56, 3): Unerwarteter Fehler bei der XamlCTask-Aufgabe.
System.IO.FileNotFoundException: Die Datei oder Assembly "Xamarin.Forms.Xaml, Version=1.4.0.0, Culture=neutral, PublicKeyToken=null" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Dateiname: 'Xamarin.Forms.Xaml, Version=1.4.0.0, Culture=neutral, PublicKeyToken=null'
bei Xamarin.Forms.Build.Tasks.XamlCTask.Compile()
bei Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
bei Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
bei Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()


What is it I have to do, to get this test to run with NCrunch as well?

Thanks for any help!
Regards
Rainer
Remco
#2 Posted : Sunday, June 28, 2015 10:42:44 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi Rainer,

This looks like an implicit reference to a build library inside the Xamarin package. See here for more information about this and how to fix it - http://www.ncrunch.net/documentation/considerations-and-constraints_implicit-file-dependencies.

Assuming you can solve the above problem, I'm afraid that I cannot guarantee that NCrunch will be able to work at all with this project. Xamarin is not supported by NCrunch at the moment.
Queck
#3 Posted : Saturday, July 4, 2015 10:21:36 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/13/2014(UTC)
Posts: 6
Location: Germany

Was thanked: 1 time(s) in 1 post(s)
Hi Remco,

thanks for the link. I at least was able to get my current tests running with NCrunch.
NCrunch is still complaining that it can't build one Project. I placed the error message below.

Regards
Rainer

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
..\..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (1151, 2): Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'nCrunch.TestRuntime, Version=2.15.0.9, Culture=neutral, PublicKeyToken=01d101bf6f3e0aea'. Perhaps it doesn't exist in the Mono for Android profile?
Dateiname: 'nCrunch.TestRuntime.dll'
bei Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
bei Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
bei Xamarin.Android.Tasks.ResolveAssemblies.Execute()


WARNING - Properties\AndroidManifest.xml (0, 0): @(Content) build action is not supported
WARNING - Properties\_SettingsStarted.txt (0, 0): @(Content) build action is not supported


Remco
#4 Posted : Saturday, July 4, 2015 11:31:18 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Sorry, I'm afraid I can't provide a solution for this problem.

This appears to be caused by a clash between the Xamarin build and NCrunch's instrumentation. As far as I know, the only way to solve this would be to actually introduce proper support for Xamarin in NCrunch.

You're welcome to vote for this feature if you like - there is a request for it up on Uservoice: https://ncrunch.uservoice.com/forums/245203-feature-requests/suggestions/5998656-support-xamarin.
Queck
#5 Posted : Sunday, July 5, 2015 1:44:51 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/13/2014(UTC)
Posts: 6
Location: Germany

Was thanked: 1 time(s) in 1 post(s)
Hi Remco,

thanks for the feedback.
The feature request you pointed out now has 3 Votes from me ;-)

Regards
Rainer
1 user thanked Queck for this useful post.
Remco on 7/5/2015(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.049 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download