我們使用英鎊開發出的瀏覽器的應用程序,我們有以下情形:英鎊數據庫的Silverlight ArgumentOutOfRangeException
- 應用程序可以用快捷鍵
- 被打開。如果我們打開編輯的文件(具體的擴展)應用程序打開。
問題是,在殼體2打開的情況下,似乎有不同IsolatedStorage和數據沒有被共享,所以我們試圖做下列
var folder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\MyApp\\";
IsolatedStorageDriver driver = new IsolatedStorageDriver(folder,true);
driver.DatabaseName = "sterling";
Database = _engine.SterlingDatabase.RegisterDatabase<OurInternalDB>(driver);
這將產生以下例外:
System.ArgumentOutOfRangeException被用戶代碼未處理 Message =指定的參數超出了有效值的範圍。 參數名:基本路徑 堆棧跟蹤: 在Wintellect.Sterling.IsolatedStorage.PathProvider._ContractForBasePath(字符串基本路徑) 在Wintellect.Sterling.IsolatedStorage.PathProvider.GetKeysPath(字符串基本路徑,字符串的databaseName,類型TABLETYPE,ISterlingDriver司機) 在Wintellect的.Sterling.IsolatedStorage.IsolatedStorageDriver.DeserializeKeys(類型類型,類型關鍵字類型,IDictionary的字典) 在Wintellect.Sterling.Keys.KeyCollection
2._DeserializeKeys() at Wintellect.Sterling.Keys.KeyCollection
2..ctor(ISterlingDriver驅動程序,函數功能2 resolver) at Wintellect.Sterling.Database.TableDefinition
2..ctor(ISterlingDriver驅動程序,函數功能2 resolver, Func
2關鍵)在Waf.Dal.Sterling的Wintellect.Sterling.Database.BaseDatabaseInstance.CreateTableDefinition [T,TKey](Func`2 keyFunction) 處的 。 Database.OURInternalDB.RegisterTables() 在Wintellect.Sterling.Database.BaseDatabaseInstance.PublishTables(ISterlingDriver駕駛員) 在Wintellect.Sterling.Database.SterlingDatabase.RegisterDatabase [T](ISterlingDriver駕駛員) 在Waf.Dal.SterlingService.Starting( ) 在Waf.Dal.Factory.Sterling.InitializeDatabase() 在Waf.Dal.AireaStorageHelper.InitializeDatabase() 在Waf.App.App..ctor() 的InnerException:
更新:我試過了替換文件夾的值
var folder = (Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\MyApp\\").Replace("\\","/");
而異常消失,但我原來的問題仍然存在,就像應用程序的2個實例使用不同的IsolatedStorages。