Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Reference to type `System.IConvertible' claims it is defined assembly `mscorlib; could not found.

$
0
0

Anytime I try to reference an NUNIT data type in the iOS framework, I am given a compiler error saying it can't find the IConvertible type

Error CS7069: Reference to type System.IConvertible' claims it is defined assemblymscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089', but it could not be found (CS7069) (logic)

I was able to reproduce this by creating a brand new Xamarin.Forms project that only targets iOS.

Immediately after creating it, I added a second Xamarin.Forms project, this time a PCL.

I then needed to add the Xamarin.iOS library so that I can reference the iOS specific APIs, specifically the Photos API. I did this by navigating to

~/Library/Frameworks/Xamarin.iOS.framework/Versions/9.0.1.29/lib/mono/Xamarin.iOS/Xamarin.iOS.dll

Lastly, I added a blank class to the new PCL project, and created a locally scoped NUNIT field. This is where the compiler error happens. This happens in my current project when I try to get the number of photos in a PHAssetCollection, as that is an NUNIT data type.

using System;

namespace logic
{
    public class EmptyClass
    {
        public EmptyClass()
        {
            nuint test = 5;
        }
    }
}

This gives me the compiler error I've referenced above. How can I solve this? This has become a blocking issue for me, am I referencing the wrong Xamarin.iOS.dll? It's not available in the list of nuget packages when I scan for them, so I can't add it via NuGet. NuGet only has Xamarin.Forms.dll available.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>