From c869ae746cd12609693a50aa7f0ed5f1eac44db6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 21 Nov 2016 12:25:42 -0500 Subject: [PATCH] add sqlite config hack --- .../MediaBrowser.Server.Mono.csproj | 11 +++++--- MediaBrowser.Server.Mono/Program.cs | 25 +++++++++++++++++-- MediaBrowser.Server.Mono/packages.config | 1 + 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj index 485bbf3a97..13d67ace5a 100644 --- a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj +++ b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj @@ -88,15 +88,16 @@ ..\packages\SQLitePCLRaw.core.1.1.1-pre20161109081005\lib\net45\SQLitePCLRaw.core.dll True + + ..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.1-pre20161109081005\lib\net45\SQLitePCLRaw.provider.sqlite3.dll + True + ..\ThirdParty\MediaBrowser.IsoMounting.Linux\MediaBrowser.IsoMounting.Linux.dll - - ..\ThirdParty\SQLitePCLRaw.provider.sqlite3.net45\System.Data.SQLite.dll - @@ -222,6 +223,10 @@ PreserveNewest + + Designer + PreserveNewest + PreserveNewest Designer diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index 39a537e1e3..88951c0f6e 100644 --- a/MediaBrowser.Server.Mono/Program.cs +++ b/MediaBrowser.Server.Mono/Program.cs @@ -35,9 +35,11 @@ namespace MediaBrowser.Server.Mono public static void Main(string[] args) { - SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3()); - var applicationPath = Assembly.GetEntryAssembly().Location; + var appFolderPath = Path.GetDirectoryName(applicationPath); + + TryCopySqliteConfigFile(appFolderPath); + SetSqliteProvider(); var options = new StartupOptions(Environment.GetCommandLineArgs()); @@ -68,6 +70,25 @@ namespace MediaBrowser.Server.Mono } } + private static void TryCopySqliteConfigFile(string appFolderPath) + { + try + { + File.Copy(Path.Combine(appFolderPath, "System.Data.SQLite.dll.config"), + Path.Combine(appFolderPath, "SQLitePCLRaw.provider.sqlite3.dll.config"), + true); + } + catch + { + + } + } + + private static void SetSqliteProvider() + { + SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3()); + } + private static ServerApplicationPaths CreateApplicationPaths(string applicationPath, string programDataPath) { if (string.IsNullOrEmpty(programDataPath)) diff --git a/MediaBrowser.Server.Mono/packages.config b/MediaBrowser.Server.Mono/packages.config index 6e3fe428c1..e82ef0ed04 100644 --- a/MediaBrowser.Server.Mono/packages.config +++ b/MediaBrowser.Server.Mono/packages.config @@ -6,4 +6,5 @@ + \ No newline at end of file