diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 4c4a926a49..cb46b02b6d 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -91,7 +91,7 @@ namespace OpenSim // Configure Log4Net configSource.AddSwitch("Startup", "logconfig"); string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty); - if (logConfigFile != String.Empty) + if (!string.IsNullOrEmpty(logConfigFile)) { XmlConfigurator.Configure(new System.IO.FileInfo(logConfigFile)); m_log.InfoFormat("[OPENSIM MAIN]: configured log4net using \"{0}\" as configuration file", @@ -103,6 +103,28 @@ namespace OpenSim m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config"); } + // temporay set the platform dependent System.Drawing.Common.dll + string targetdll = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), + "System.Drawing.Common.dll"); + string src = targetdll + (Util.IsWindows() ? ".win" : ".linux"); + try + { + if (!File.Exists(targetdll)) + File.Copy(src, targetdll); + else + { + FileInfo targetInfo = new(targetdll); + FileInfo srcInfo = new(src); + if(targetInfo.Length != srcInfo.Length) + File.Copy(src, targetdll, true); + } + } + catch (Exception e) + { + m_log.Error("Failed to copy System.Drawing.Common.dll for current platform" + e.Message); + throw; + } + m_log.InfoFormat( "[OPENSIM MAIN]: System Locale is {0}", System.Threading.Thread.CurrentThread.CurrentCulture); if(!Util.IsWindows()) diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs index b57580b6d8..d7079dac9a 100644 --- a/OpenSim/Server/ServerMain.cs +++ b/OpenSim/Server/ServerMain.cs @@ -141,6 +141,29 @@ namespace OpenSim.Server connList = string.Join(",", servicesList.ToArray()); } + // temporay set the platform dependent System.Drawing.Common.dll + string targetdll = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), + "System.Drawing.Common.dll"); + string src = targetdll + (Util.IsWindows() ? ".win" : ".linux"); + try + { + if (!File.Exists(targetdll)) + File.Copy(src, targetdll); + else + { + FileInfo targetInfo = new(targetdll); + FileInfo srcInfo = new(src); + if (targetInfo.Length != srcInfo.Length) + File.Copy(src, targetdll, true); + } + } + catch (Exception e) + { + m_log.Error("Failed to copy System.Drawing.Common.dll for current platform" + e.Message); + throw; + } + + string[] conns = connList.Split(new char[] {',', ' ', '\n', '\r', '\t'}); foreach (string c in conns)