此异常有时有,有时正常,代码如下:
public static class Settings
{
private static IsolatedStorageSettings _isolatedStorageSettings = null;
static Settings()
{
Settings._isolatedStorageSettings = IsolatedStorageSettings.ApplicationSettings;// 此句有时报错,有时正常
}
}
在静态构造方法里面,构造IsolatedStorageSettings时频繁会抛出“类型初始化错误”,然后调试查看内部异常就是:Operation
not permitted on IsolatedStorageFileStream
何故???