I have a new Silverlight Application with just a button on it that works great locally.
I deploy to my staging server and now the following code breaks:
public MainPage()
{
InitializeComponent();
try
{
MessageBox.Show("Attempting to Access Isolated Storage");
var store = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication();
MessageBox.Show("Have Storage");
}
catch (Exception ex)
{
MessageBox.Show("1: Access Failed");
MessageBox.Show(ex.Message);
MessageBox.Show(ex.StackTrace);
}
}
I wrote this sample app to discover what was going on in my real application. It has the same issue. My real application did work for weeks, until a few days ago. I cannot determine what is different.
Here is the Message:
---------------------------
---------------------------
There is not enough free space to perform the operation.
---------------------------
OK
---------------------------
Here is the stack trace:
---------------------------
---------------------------
at System.IO.IsolatedStorage.IsolatedStorageFile.Reserve(UInt64 lReserve)
at System.IO.IsolatedStorage.IsolatedStorageFile.FetchOrCreateStore(String groupName, String storeName, IsolatedStorageFile isf)
at System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStore(String group, String id)
at System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication()
at SilverlightApplication1.MainPage..ctor()
---------------------------
OK
---------------------------
Thanks.
I guess you gave the answer yourself in the post: “There is not enough free space to perform the operation.” Try to increase the size of the IsolatedStorage:
http://msdn.microsoft.com/en-us/library/system.io.isolatedstorage.isolatedstoragefile.increasequotato(v=vs.95).aspx
Also you might want to clean up the IsolatedStorage after usage. Maybe thatswhy your application worked for some days and then suddenly it broke. I guess the IsolatedStorage is just “full”. Try this at the end of your code:
Maybe also see here for some nice IsolatedStorage examples:
http://msdn.microsoft.com/en-us/library/cc265154%28v=VS.95%29.aspx
Hope I could help