2

I'm currently using Xamarin to make some quick mobile application. However, I'm trying to use Shared Project in order to write some JSON data in a file in both Android and iOS.

If I put my object serializing data and saving it inside of two distinct Class in the Android or iOS part it works well.

However, when I use

File.WriteAllText(filename, contents);

Which is contained in System.IO I got the following error :

The name 'File' does not exist in the current context

I believed that I could use everything in Shared Project but this does not seem to be the case. Am I doing something wrong ?

Pictar
  • 47
  • 9
  • You're doing things right but I/O isn't as _shared_ as you (we) may wish. Take a look to https://developer.xamarin.com/guides/xamarin-forms/working-with/files/. I never played _seriously_ with Xamarin then I can't provide anything more than a link, sorry. – Adriano Repetti Oct 11 '16 at 12:13
  • It should work if it is actually a shared project type. Not PCL or library – svn Oct 11 '16 at 13:00

0 Answers0