30 using System.Reflection;
32 namespace OpenSim.
Region.ScriptEngine.Shared
38 ResolveEventArgs args)
40 if (!(sender is System.AppDomain))
43 AppDomain myDomain = (AppDomain)sender;
44 string dirName = myDomain.FriendlyName;
45 string ScriptEnginesPath = myDomain.SetupInformation.PrivateBinPath;
47 string[] pathList =
new string[] {
"",
"bin", ScriptEnginesPath,
48 Path.Combine(ScriptEnginesPath, dirName)};
50 string assemblyName = args.Name;
51 if (assemblyName.IndexOf(
",") != -1)
52 assemblyName = args.Name.Substring(0, args.Name.IndexOf(
","));
54 foreach (
string s
in pathList)
56 string path = Path.Combine(Directory.GetCurrentDirectory(),
57 Path.Combine(s, assemblyName))+
".dll";
61 if (File.Exists(path))
62 return Assembly.LoadFrom(path);
static Assembly OnAssemblyResolve(object sender, ResolveEventArgs args)