add automatic copy of System.Drawing.Common.dll for the current platform, that is still needed

This commit is contained in:
UbitUmarov
2023-01-26 18:52:02 +00:00
parent 306df20003
commit 4358ab54b0
2 changed files with 46 additions and 1 deletions

View File

@@ -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)