views:

153

answers:

0

I'm using SubSonic 2.2 and the .net provider for sqlite in a client application. I'm calling SubSonic.DataService.Provider and it's taking ages, e.g. 30 seconds, to return. Stepping through the SubSonic code it appears to be taking the time on this line within DataService.LoadProviders():

ProvidersHelper.InstantiateProviders(section.Providers, 
   _providers, typeof(DataProvider));

This is ProvidersHelper within System.Web.Configuration namespace.

The config file section it's using looks like this:

<SubSonicService defaultProvider="xLocal">
  <providers>
    <clear />
    <add name="xLocal" 
         type="SubSonic.SQLiteDataProvider, SubSonic" 
         connectionStringName="xLocal" 
         generatedNamespace="MyApp.MyNamespace.DAL" />
  </providers>
</SubSonicService>

That connection string looks like this:

<add name="xLocal" 
     connectionString="Data Source=C:\Program Files\MyApp\xlocal.s3db;"
     providerName="System.Data.SQLite" />

I'm guessing that for some reason the CLR is having trouble locating or loading the sqlite provider. However, the SubSonic.dll and System.Data.SQLite.dll files are in the same folder as the application exe so I don't see what the problem should be.

Any thoughts on how I can investigate why it's taking so long or speed things up? I'd prefer not to put SubSonic or System.Data.SQLite into the GAC.