diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-11-21 13:50:14 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-21 13:50:14 -0500 |
| commit | e439bbba42c082b8e50ff35d6dba68857b62c9aa (patch) | |
| tree | 432bc48932b75dd48d92db96b2b550a21f757546 /MediaBrowser.Server.Mono/Program.cs | |
| parent | bc113bf095b03cb1ecef06c8675a888792b33d7d (diff) | |
| parent | 62f84acd2640de815992436ceb392b199af656de (diff) | |
Merge pull request #2300 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Mono/Program.cs')
| -rw-r--r-- | MediaBrowser.Server.Mono/Program.cs | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index 39a537e1e..88951c0f6 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)) |
