Index: System.Data.SQLite/UnsafeNativeMethods.cs ================================================================== --- System.Data.SQLite/UnsafeNativeMethods.cs +++ System.Data.SQLite/UnsafeNativeMethods.cs @@ -355,11 +355,11 @@ ///////////////////////////////////////////////////////////////////////// #region Private Data /// /// This lock is used to protect the static and - /// field. + /// fields. /// private static readonly object staticSyncRoot = new object(); ///////////////////////////////////////////////////////////////////////// /// @@ -3025,17 +3025,33 @@ if (fileNameOnly == null) return false; // // NOTE: If the native SQLite library exists in the base directory - // itself, stop now. + // itself, possibly stop now. // string fileName = FixUpDllFileName(MaybeCombinePath(baseDirectory, fileNameOnly)); - if (!allowBaseDirectoryOnly && File.Exists(fileName)) - return false; + if (File.Exists(fileName)) + { + // + // NOTE: If the caller is allowing the base directory itself + // to be used, also make sure a processor architecture + // was not specified; if either condition is false just + // stop now and return failure. + // + if (allowBaseDirectoryOnly && + String.IsNullOrEmpty(processorArchitecture)) + { + goto baseDirOnly; + } + else + { + return false; + } + } // // NOTE: If the specified processor architecture is null, use the // default. // @@ -3084,10 +3100,12 @@ // NOTE: If the file does not exist, skip trying to load it. // if (!File.Exists(fileName)) return false; } + + baseDirOnly: try { #if !NET_COMPACT_20 && TRACE_PRELOAD try