title: Sterling database silverlight ArgumentOutOfRangeException
body: <p>We are developing an out-of-browser application using sterling and we have the following scenario:</p>
  
  <ol>
  <li>The app can be opened with a shortcut</li>
  <li>If we open-edit files (with specific extension) the app opens up.</li>
  </ol>
  
  <p>Problem is that instances opened in case 2 seems to have a different IsolatedStorage and data is not being shared, so we tried to do the following</p>
  
  <pre><code> var folder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\MyApp\\";
   IsolatedStorageDriver driver = new IsolatedStorageDriver(folder,true);
          driver.DatabaseName = "sterling";
          Database = _engine.SterlingDatabase.RegisterDatabase&lt;OurInternalDB&gt;(driver);
  </code></pre>
  
  <p>This produces the following exception:</p>
  
  <blockquote>
    <p>System.ArgumentOutOfRangeException was unhandled by user code
      Message=Specified argument was out of the range of valid values.
    Parameter name: basePath
      StackTrace:
           at Wintellect.Sterling.IsolatedStorage.PathProvider._ContractForBasePath(String basePath)
           at Wintellect.Sterling.IsolatedStorage.PathProvider.GetKeysPath(String basePath, String databaseName, Type tableType, ISterlingDriver driver)
           at Wintellect.Sterling.IsolatedStorage.IsolatedStorageDriver.DeserializeKeys(Type type, Type keyType, IDictionary dictionary)
           at Wintellect.Sterling.Keys.KeyCollection<code>2._DeserializeKeys()
           at Wintellect.Sterling.Keys.KeyCollection</code>2..ctor(ISterlingDriver driver, Func<code>2 resolver)
           at Wintellect.Sterling.Database.TableDefinition</code>2..ctor(ISterlingDriver driver, Func<code>2 resolver, Func</code>2 key)
           at Wintellect.Sterling.Database.BaseDatabaseInstance.CreateTableDefinition[T,TKey](Func`2 keyFunction)
           at Waf.Dal.Sterling.Database.OURInternalDB.RegisterTables()
           at Wintellect.Sterling.Database.BaseDatabaseInstance.PublishTables(ISterlingDriver driver)
           at Wintellect.Sterling.Database.SterlingDatabase.RegisterDatabase[T](ISterlingDriver driver)
           at Waf.Dal.SterlingService.Starting()
           at Waf.Dal.Factory.Sterling.InitializeDatabase()
           at Waf.Dal.AireaStorageHelper.InitializeDatabase()
           at Waf.App.App..ctor()
      InnerException: </p>
  </blockquote>
  
  <p>Update: I tried to replace the folder value </p>
  
  <pre><code>var folder = (Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\MyApp\\").Replace("\\","/"); 
  </code></pre>
  
  <p>And the exception goes away, but my original problem persists, it's like the 2 instances of the app are using different IsolatedStorages.</p>