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

Notification

Icon
Error

F# Xamarin.iOS library project fails to build (Cecil exception)
pragmatrix
#1 Posted : Friday, June 17, 2016 2:40:18 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/21/2014(UTC)
Posts: 5
Location: Germany

Was thanked: 2 time(s) in 2 post(s)
Hi, I'm getting a "Build failure" with NCrunch and VS2015 Update 2 when I create an F# library project and explicitly refer FSharp.Core and mscorlib from the Xamarin.iOS framework (latest version at the time of this writing). Regular build works fine and I don't see another option to build a F# library and use it from a C# iOS project.

I was able to reduce the issue down to a simple type definition and created a small project here: https://github.com/pragmatrix/NCrunchFSharpiOSLib
And a zip file is here: https://github.com/pragm...chFSharpiOSLib/releases

May be it's just a Cecil hickup, or am I doing something wrong?

Stacktrace:

Code:

System.NullReferenceException: Object reference not set to an instance of an object.
at _Mono.Cecil.TypeSystem.LookupSystemType(String name, ElementType element_type)
at _Mono.Cecil.TypeSystem.get_String()
at _Mono.Cecil.SignatureReader.GetPrimitiveType(ElementType etype)
at _Mono.Cecil.SignatureReader.ReadTypeSignature(ElementType etype)
at _Mono.Cecil.SignatureReader.ReadGenericInstanceSignature(IGenericParameterProvider provider, IGenericInstance instance)
at _Mono.Cecil.SignatureReader.ReadTypeSignature(ElementType etype)
at _Mono.Cecil.MetadataReader.GetTypeSpecification(UInt32 rid)
at _Mono.Cecil.MetadataReader.LookupToken(MetadataToken token)
at _Mono.Cecil.MetadataReader.ReadType(UInt32 rid)
at _Mono.Cecil.MetadataReader.InitializeTypeDefinitions()
at _Mono.Cecil.MetadataReader.ReadTypes()
at _Mono.Cecil.ModuleDefinition.<>c.<get_Types>b__72_0(ModuleDefinition _, MetadataReader reader)
at _Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at _Mono.Cecil.ModuleDefinition.get_Types()
at _Mono.Cecil.ModuleDefinition.GetType(String namespace, String name)
at _Mono.Cecil.MetadataResolver.GetType(ModuleDefinition module, TypeReference type)
at _Mono.Cecil.MetadataResolver.Resolve(IAssemblyResolver resolver, TypeReference type)
at _Mono.Cecil.TypeReference.Resolve()
at _Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
at _Mono.Cecil.SignatureReader.ReadCustomAttributeEnum(TypeReference enum_type)
at _Mono.Cecil.SignatureReader.ReadCustomAttributeElementValue(TypeReference type)
at _Mono.Cecil.SignatureReader.ReadCustomAttributeElement(TypeReference type)
at _Mono.Cecil.SignatureReader.ReadCustomAttributeFixedArgument(TypeReference type)
at _Mono.Cecil.SignatureReader.ReadCustomAttributeConstructorArguments(CustomAttribute attribute, Collection`1 parameters)
at _Mono.Cecil.MetadataReader.ReadCustomAttributeSignature(CustomAttribute attribute)
at _Mono.Cecil.CustomAttribute.<Resolve>b__32_0(CustomAttribute attribute, MetadataReader reader)
at _Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at _Mono.Cecil.CustomAttribute.Resolve()
at _Mono.Cecil.CustomAttribute.get_Properties()
at nCrunch.Compiler.AssemblyHashGenerator.(BinaryWriter , IEnumerable`1 )
at nCrunch.Compiler.AssemblyHashGenerator.(BinaryWriter , TypeDefinition )
at nCrunch.Compiler.AssemblyHashGenerator.ComputeHashForAssembly(AssemblyDefinition assembly)
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.GenerateSurfaceHash()
at nCrunch.Compiler.RemoteBuildRunner..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters , FilePath , BuildOutput , DirectoryPath[] , FilePath[] )
at nCrunch.Compiler.RemoteBuildRunner..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters )
Remco
#2 Posted : Friday, June 17, 2016 11:45:26 PM(UTC)
Rank: NCrunch Developer

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

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

I'm sorry, but at the moment, Xamarin and .NET core are not yet supported by NCrunch.

There are plans to implement support for .NET Core when this platform is eventually stabilised, and from there it will be possible to assess the feasibility of supporting Xamarin platforms.
pragmatrix
#3 Posted : Saturday, June 18, 2016 8:45:09 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/21/2014(UTC)
Posts: 5
Location: Germany

Was thanked: 2 time(s) in 2 post(s)
Thank you Remco, it would be great if a future NCrunch version would show a warning if it's encountering an unsupported project type.
1 user thanked pragmatrix for this useful post.
Remco on 6/18/2016(UTC)
pragmatrix
#4 Posted : Monday, June 20, 2016 11:55:46 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/21/2014(UTC)
Posts: 5
Location: Germany

Was thanked: 2 time(s) in 2 post(s)
Hi, I've managed to get NCrunch to run tests by using a F# portable library profile 7, which is used my iOS application and referred by another regular .NET 4.5 library that contains the XUnit tests. Of course, that implies that the F# library does nothing iOS specific, so YMMV, .... I'm now NCrunching again :)
1 user thanked pragmatrix for this useful post.
Remco on 6/20/2016(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.029 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download