System.Data.SQLite
Check-in [e0c2dcac4c]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Modify the native library pre-loader to recognize the 'PreLoadSQLite_BaseDirectory' environment variable as an override for the base directory to use.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e0c2dcac4c34e2a253611fe6163ea29c365acd33
User & Date: mistachkin 2012-03-22 15:45:36
Context
2012-03-23
12:09
Lock access to the static data used by the native SQLite library pre-load mechanism. check-in: 5ba5fc374d user: mistachkin tags: trunk
2012-03-22
15:45
Modify the native library pre-loader to recognize the 'PreLoadSQLite_BaseDirectory' environment variable as an override for the base directory to use. check-in: e0c2dcac4c user: mistachkin tags: trunk
2012-03-19
23:09
Update SQLite core to the latest trunk. Skip test for ticket [72905c9a77] in the debug build, due to the extra trace output. check-in: 39ca5d3494 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/UnsafeNativeMethods.cs.

146
147
148
149
150
151
152














153
154
155
156
157
158
159
      /// <returns>
      /// The base directory for the current application domain -OR- null if it
      /// cannot be determined.
      /// </returns>
      private static string GetBaseDirectory()
      {
#if !PLATFORM_COMPACTFRAMEWORK














          return AppDomain.CurrentDomain.BaseDirectory;
#else
          Assembly assembly = Assembly.GetExecutingAssembly();

          if (assembly == null)
              return null;








>
>
>
>
>
>
>
>
>
>
>
>
>
>







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
      /// <returns>
      /// The base directory for the current application domain -OR- null if it
      /// cannot be determined.
      /// </returns>
      private static string GetBaseDirectory()
      {
#if !PLATFORM_COMPACTFRAMEWORK
          //
          // NOTE: If the "PreLoadSQLite_BaseDirectory" environment variable
          //       is set, use it verbatim for the base directory.
          //
          string directory = Environment.GetEnvironmentVariable(
              "PreLoadSQLite_BaseDirectory");

          if (directory != null)
              return directory;

          //
          // NOTE: Otherwise, fallback on using the base directory of the
          //       current application domain.
          //
          return AppDomain.CurrentDomain.BaseDirectory;
#else
          Assembly assembly = Assembly.GetExecutingAssembly();

          if (assembly == null)
              return null;