diff options
author | Fernando Oliveira | 2013-10-16 20:15:04 -0500 |
---|---|---|
committer | fernando | 2013-10-16 20:16:29 -0500 |
commit | 8fdf70b87e51bdd2035f5ab54a335fbb50d79e80 (patch) | |
tree | e3c3851c1237072926598964e366cd1105cf005d /OpenSim/Data/PGSQL/PGSQLManager.cs | |
parent | BulletSim: implement the SL bug where VEHICLE_HOVER_UP_ONLY disables (diff) | |
download | opensim-SC_OLD-8fdf70b87e51bdd2035f5ab54a335fbb50d79e80.zip opensim-SC_OLD-8fdf70b87e51bdd2035f5ab54a335fbb50d79e80.tar.gz opensim-SC_OLD-8fdf70b87e51bdd2035f5ab54a335fbb50d79e80.tar.bz2 opensim-SC_OLD-8fdf70b87e51bdd2035f5ab54a335fbb50d79e80.tar.xz |
* Fixes mantis mantis 0006803 [PGSQL] - Simulator crashes - Mono.Security.dll missing. The root of the issue is that the Postgres driver relies on Mono.Security.dll from the mono project. Unfortunately, when using Mono, including the dll in the distribution causes conflicts. This solution puts Mono.Security.dll in bin/lib/NET/ and, if windows .NET is the runtime, informs the assembly loader to load bin/lib/NET/Mono.Security.dll when .NET is scanning for the Mono.Security namespace. On Mono, the included Mono.Security assembly is ignored.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLManager.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLManager.cs b/OpenSim/Data/PGSQL/PGSQLManager.cs index 3ddaf38..2084fe9 100644 --- a/OpenSim/Data/PGSQL/PGSQLManager.cs +++ b/OpenSim/Data/PGSQL/PGSQLManager.cs | |||
@@ -30,6 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.Data; | 30 | using System.Data; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using OpenSim.Framework; | ||
33 | using log4net; | 34 | using log4net; |
34 | using OpenMetaverse; | 35 | using OpenMetaverse; |
35 | using Npgsql; | 36 | using Npgsql; |
@@ -56,6 +57,29 @@ namespace OpenSim.Data.PGSQL | |||
56 | public PGSQLManager(string connection) | 57 | public PGSQLManager(string connection) |
57 | { | 58 | { |
58 | connectionString = connection; | 59 | connectionString = connection; |
60 | InitializeMonoSecurity(); | ||
61 | } | ||
62 | |||
63 | public void InitializeMonoSecurity() | ||
64 | { | ||
65 | if (!Util.IsPlatformMono) | ||
66 | { | ||
67 | AppDomain currentDomain = AppDomain.CurrentDomain; | ||
68 | currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); | ||
69 | } | ||
70 | } | ||
71 | |||
72 | private System.Reflection.Assembly ResolveEventHandlerMonoSec(object sender, ResolveEventArgs args) | ||
73 | { | ||
74 | Assembly MyAssembly = null; | ||
75 | |||
76 | if (args.Name.Substring(0, args.Name.IndexOf(",")) == "Mono.Security") | ||
77 | { | ||
78 | MyAssembly = Assembly.LoadFrom("lib/NET/Mono.Security.dll"); | ||
79 | } | ||
80 | |||
81 | //Return the loaded assembly. | ||
82 | return MyAssembly; | ||
59 | } | 83 | } |
60 | 84 | ||
61 | /// <summary> | 85 | /// <summary> |