diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-21 12:25:42 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-21 12:25:42 -0500 |
| commit | c869ae746cd12609693a50aa7f0ed5f1eac44db6 (patch) | |
| tree | d25bab442c9f78d24d330c891f3192d896f299fa | |
| parent | 1acebd992229ee9bd6e7677f68174672fae53622 (diff) | |
add sqlite config hack
| -rw-r--r-- | MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj | 11 | ||||
| -rw-r--r-- | MediaBrowser.Server.Mono/Program.cs | 25 | ||||
| -rw-r--r-- | 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 485bbf3a9..13d67ace5 100644 --- a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj +++ b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj @@ -88,15 +88,16 @@ <HintPath>..\packages\SQLitePCLRaw.core.1.1.1-pre20161109081005\lib\net45\SQLitePCLRaw.core.dll</HintPath> <Private>True</Private> </Reference> + <Reference Include="SQLitePCLRaw.provider.sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=62684c7b4f184e3f, processorArchitecture=MSIL"> + <HintPath>..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.1-pre20161109081005\lib\net45\SQLitePCLRaw.provider.sqlite3.dll</HintPath> + <Private>True</Private> + </Reference> <Reference Include="System" /> <Reference Include="MediaBrowser.IsoMounting.Linux"> <HintPath>..\ThirdParty\MediaBrowser.IsoMounting.Linux\MediaBrowser.IsoMounting.Linux.dll</HintPath> </Reference> <Reference Include="System.Configuration" /> <Reference Include="System.Data" /> - <Reference Include="System.Data.SQLite"> - <HintPath>..\ThirdParty\SQLitePCLRaw.provider.sqlite3.net45\System.Data.SQLite.dll</HintPath> - </Reference> <Reference Include="System.IO.Compression" /> <Reference Include="System.Runtime.Serialization" /> <Reference Include="System.ServiceModel" /> @@ -222,6 +223,10 @@ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Include="packages.config" /> + <None Include="SQLitePCLRaw.provider.sqlite3.dll.config"> + <SubType>Designer</SubType> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <None Include="System.Data.SQLite.dll.config"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <SubType>Designer</SubType> 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)) diff --git a/MediaBrowser.Server.Mono/packages.config b/MediaBrowser.Server.Mono/packages.config index 6e3fe428c..e82ef0ed0 100644 --- a/MediaBrowser.Server.Mono/packages.config +++ b/MediaBrowser.Server.Mono/packages.config @@ -6,4 +6,5 @@ <package id="SharpCompress" version="0.14.0" targetFramework="net46" /> <package id="SimpleInjector" version="3.2.4" targetFramework="net46" /> <package id="SQLitePCLRaw.core" version="1.1.1-pre20161109081005" targetFramework="net46" /> + <package id="SQLitePCLRaw.provider.sqlite3.net45" version="1.1.1-pre20161109081005" targetFramework="net46" /> </packages>
\ No newline at end of file |
