I decided to use isolated storage for temporary files:
using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForDomain())
{
using (IsolatedStorageFileStream userStream = new IsolatedStorageFileStream("UserSettings.set", FileMode.Create, isoStore))
{
}
}
I taken this code from example that works on this computer. And minimal project with just this code also sucessfully runs.
But while performing IsolatedStorageFileStream
constructor in my current project following message appears:
MyApp.exe - Assert Failure
Expression: [mscorlib recursive resource lookup bug]
Desctiprion: Infinite recurion during resource lookup within mscorlib. This may be a bug in mscorlib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names.
Resource name: Serurity_Generic
And in this message I can see pretty big stack trace (it starts with call of IsolatedStorageFileStream
constructor):
Also I can't catch exception from this code.
Looks like error happened in System.Environment.ResourceHelper.GetResourceStringCode()
.
What can be a possible reason for this? I can't find anything on this topic.
Deleting C:\Users\user\AppData\Local\IsolatedStorage
folder doesn't solve the problem (I know for sure that there is only my folders).