I've created a Xamarin.Forms project that uses PCLStorage. I've added PCLStorage from Nuget to all projects in the solution (iOS, Android, Win Phone and shared). When I run the app in the iOS simulator or on my iPhone 5s device I get "System.NotImplementedException: This functionality is not implemented in the portable version of this assembly.".
I've tried changing"Linke behaviour" to "Don't link" in the project settings and tried adding a "LinkerPleaseInclude" class to my iOS project for PCLStorage (as described here: http://forums.xamarin.com/discussion/18356/build-fails-for-iphone-but-is-fine-with-android-and-iphonesimulator) without success.
If I run the app/solution with Xamarin Studio on my Mac everything works.
Posts
The exception has nothing to do with Linking. It's saying that a method that is being called by the DI Interface hasn't been implemented on the platform.
On first glance, it appears as thought they're throwing the exception on 'Portable' (whatever that means).
It's really quite simple to roll your own Storage Service.. you can actually just rip out the necessary bits from here.
Just put the Interface in your PCL
And implement it on each platform.
Here's the Android Implementation
And here's the iOS implementation
Thanks chase!
I think it's strange that it works in Xamarin Studio but not in Visual Studio?
I'm using PCLStorage to implement settings so maybe it's better to use your implenetation instead.
The non-mvvmcross version of settings is here: https://github.com/jamesmontemagno/Xam.PCL.Plugins/tree/master/Settings
@JamesMontemagno Great! I'm using it now with success. Thanks!
This worked for me : http://blog.blackballsoftware.com/2014/04/03/pclstorage-in-xamarin-ios-project/
I also got this error (windows phone project).
Setup:
Core PCL
Win Phone App
Win Phone Background Agent.
The error happened on startup of the app - but the problem turned out to be that I hadn't added the nuget reference to the background agent project.
Thanks @BenoitPaquin! In case link rot occurs, the solution to problem is to set CopyLocal = False on the PCLStorage and PCLStorage.Abstractions references in your PCL project. Be sure to add the package to each platform-specific project.
I have the same issue with Windows Phone 8.1. Setting CopyLocal to false for the PclStorage package in the PCL project did not resolve it.
Anyone having the same problem as me ?