Reputation: 186
I'm creating a mobile android application and I put all non gui-related logic in a portable class library (PCL). Inside that library I'm trying to do the following
if (!Directory.Exists(path)) {
Directory.CreateDirectory (path);
}
When building, the compiler says the Directory class is not found even when I imported the namespace (using System.IO) and checked that the reference is there, inside .Net portable Subset.
I tried do the same on the android project it works fine.
Upvotes: 0
Views: 588
Reputation: 186
As Jason pointed, that what I'm trying to do is not supported. From what I saw I had to options:
In the end I decided to go for the first aproach since my project is android-only.
Upvotes: 0
Reputation: 89082
A PCL whose targets include Windows Phone (which is the default profile for Xamarin iOS/Android PCLs) will not include System.IO classes, because Windows Phone does not support direct file IO.
Upvotes: 2