Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
IsolatedStorageFile.GetUserStoreForApplication () causes a crash on iOS 8.
**Steps to Reproduce:**
Was not able to reproduce locally, but Apple rejected apps crashing with the below Actual Results.
> at System.IO.Directory.CreateDirectory (string) <0x0008c>
> at System.Environment.UnixGetFolderPath (System.Environment/SpecialFolder,System.Environment/SpecialFolderOption) <0x001c4>
> at System.IO.IsolatedStorage.IsolatedStorageFile.GetIsolatedStorageRoot (System.IO.IsolatedStorage.IsolatedStorageScope) <0x00050>
> at System.IO.IsolatedStorage.IsolatedStorageFile.PostInit () <0x00020>
> at System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication () <0x00054>
**Build Date & Platform:**
This may be related to the System.Environment.SpecialFolderOption issue related to the path changes noted here: http://developer.xamarin.com/guides/ios/application_fundamentals/working_with_the_file_system/
@Sebastien, can you confirm this is related?
Yes. It's unclear why you could not duplicate it... in fact it was surprising we never hit the issue ourselves (that's covered in our test suites).
I'm beginning to suspect this only happens on non-development devices (a bit like the stdout issue for iOS 5.1).
Can you try something for me ? if you still have that test case on any device then reboot* that device and (unconnected to a Mac) try again. Then tell me if the app is working (or crashing like above).
* The reboot should give you a somewhat "clean" device, one that does not have the "dev image" loaded (which will happen if you use Xcode and XS/VS to deploy/start an app).
I tried a few things, but I could not get it to crash. I tried what you suggested with the following code:
> var documents = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments);
> var filename = Path.Combine (documents, "Write.txt");
> File.WriteAllText(filename, "Write this text into a file");
If there is a better test case I should use, let me know.
@John no better case. I'm fairly sure the issue is "hidden" on devices in development mode. That would explain why this is not seen in our (and customers) testing.
This was fixed in master / 95bb44d4c5e31e4175cc6a820b2ca70d837d7202 (unreleased)
However the existing workaround  does not work for isolated storage, since the path is built inside mscorlib.dll itself.
*** Bug 24384 has been marked as a duplicate of this bug. ***
Please ship a fix asap. I spoke with 2 other peoples that was having their app rejected for the same reason. But they didn't have any log and didn't understand the root cause.