aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Mono/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Mono/Program.cs')
-rw-r--r--MediaBrowser.Server.Mono/Program.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs
index 6d3cbcf26..057a2456f 100644
--- a/MediaBrowser.Server.Mono/Program.cs
+++ b/MediaBrowser.Server.Mono/Program.cs
@@ -17,6 +17,7 @@ using System.Security.Cryptography.X509Certificates;
using Gtk;
using Gdk;
using System.Threading.Tasks;
+using System.Reflection;
namespace MediaBrowser.Server.Mono
{
@@ -203,6 +204,8 @@ namespace MediaBrowser.Server.Mono
logger.Info("Server: {0}", Environment.MachineName);
logger.Info("Operating system: {0}", Environment.OSVersion.ToString());
+
+ MonoBug11817WorkAround.Apply ();
}
/// <summary>
@@ -280,4 +283,34 @@ namespace MediaBrowser.Server.Mono
return true;
}
}
+
+ public class MonoBug11817WorkAround
+ {
+ public static void Apply()
+ {
+ var property = typeof(TimeZoneInfo).GetProperty("TimeZoneDirectory", BindingFlags.Static | BindingFlags.NonPublic);
+
+ if (property == null) return;
+
+ var zoneInfo = FindZoneInfoFolder();
+ property.SetValue(null, zoneInfo, new object[0]);
+ }
+
+ public static string FindZoneInfoFolder()
+ {
+ var current = new DirectoryInfo(Directory.GetCurrentDirectory());
+
+ while(current != null)
+ {
+ var zoneinfoTestPath = Path.Combine(current.FullName, "zoneinfo");
+
+ if (Directory.Exists(zoneinfoTestPath))
+ return zoneinfoTestPath;
+
+ current = current.Parent;
+ }
+
+ return null;
+ }
+ }
}