diff options
author | Justin Clark-Casey (justincc) | 2012-02-07 17:44:37 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-02-07 17:44:37 +0000 |
commit | 038d1bf742ba4f95ca8a83b27f6fefb755485524 (patch) | |
tree | ec03beab5a4c0a3afd75b685d629f9d82d4199b9 /OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs | |
parent | Revert my two quick fixes for the lag issue and put in the real fix, which (diff) | |
download | opensim-SC-038d1bf742ba4f95ca8a83b27f6fefb755485524.zip opensim-SC-038d1bf742ba4f95ca8a83b27f6fefb755485524.tar.gz opensim-SC-038d1bf742ba4f95ca8a83b27f6fefb755485524.tar.bz2 opensim-SC-038d1bf742ba4f95ca8a83b27f6fefb755485524.tar.xz |
Add a regression test to compile and start a script. Remove Path.GetDirectoryName when getting assembly loading path in Compiler.CompileFromDotNetText().
The Path.GetDirectoryName call in Compiler.CompileFromDotNetText is unnecessary since AppDomain.CurrentDomain.BaseDirectory is always a directory.
Later path concatenation is already done by Path.Combine() which handles any trailing slash.
Removing Path.GetDirectoryName() will not affect the runtime but allows NUnit to work since it doesn't add a trailing slash to AppDomain.CurrentDomain.BaseDirectory.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs index 130e197..e35f79f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
44 | string dirName = myDomain.FriendlyName; | 44 | string dirName = myDomain.FriendlyName; |
45 | string ScriptEnginesPath = myDomain.SetupInformation.PrivateBinPath; | 45 | string ScriptEnginesPath = myDomain.SetupInformation.PrivateBinPath; |
46 | 46 | ||
47 | string[] pathList = new string[] {"bin", ScriptEnginesPath, | 47 | string[] pathList = new string[] {"", "bin", ScriptEnginesPath, |
48 | Path.Combine(ScriptEnginesPath, dirName)}; | 48 | Path.Combine(ScriptEnginesPath, dirName)}; |
49 | 49 | ||
50 | string assemblyName = args.Name; | 50 | string assemblyName = args.Name; |
@@ -56,6 +56,8 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
56 | string path = Path.Combine(Directory.GetCurrentDirectory(), | 56 | string path = Path.Combine(Directory.GetCurrentDirectory(), |
57 | Path.Combine(s, assemblyName))+".dll"; | 57 | Path.Combine(s, assemblyName))+".dll"; |
58 | 58 | ||
59 | // Console.WriteLine("Trying to resolve {0}", path); | ||
60 | |||
59 | if (File.Exists(path)) | 61 | if (File.Exists(path)) |
60 | return Assembly.LoadFrom(path); | 62 | return Assembly.LoadFrom(path); |
61 | } | 63 | } |