oysteinkrog / SQLite.Net-PCL

Simple, powerful, cross-platform SQLite client and ORM - Updated version with PCL support
MIT License
353 stars 162 forks source link

Fix on directory ref to SQLite.Interop.dll +++ DateTimie fix #337

Closed Maschina closed 2 years ago

Maschina commented 7 years ago

Fix on wrong base directory for SQLite.Interop.dll which causes an exception, if "shadow copies" are enabled. I experienced this issue when building an add-in for Outlook. By having shadow copies enabled (.NET shadow copies), the SQLite.Net.Platform.Win32.dll will be copied into a shadow directory. Thus, by using Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), the LoadLibrary tries to load interop library from a relative path, which of course does not exist in that shadow path.

Maschina commented 7 years ago

I added a further commit fixing a bug in the DateTime conversion. When retrieving data back from sqlite table to the application, the DateTime values are not automatically converted to the original local time. The time values are kept in UTC.