aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Mono/Program.cs
diff options
context:
space:
mode:
authorSven Van den brande <sven.vandenbrande@outlook.com>2013-10-31 21:46:03 +0100
committerSven Van den brande <sven.vandenbrande@outlook.com>2013-10-31 21:46:03 +0100
commite8f8d6651c86b3fd3350a5afae1d759fbbad06bd (patch)
tree6496b1525f0dfc448f0250f4fddaa634296ae94b /MediaBrowser.Server.Mono/Program.cs
parent28ab28768a307d1cac60ebe79163b98291068cde (diff)
parent882d0681e68c5e0ae663cca75752e4df765c8dd5 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
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;
+ }
+ }
}