diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 8a279675ff..9d36986e73 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -159,12 +159,26 @@ namespace OpenSim protected virtual void LoadPlugins() { IConfig startupConfig = Config.Configs["Startup"]; - string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation",".") : "."; + string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation", String.Empty) : String.Empty; - using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this), registryLocation)) + // The location can also be specified in the environment. If there + // is no location in the configuration, we must call the constructor + // without a location parameter to allow that to happen. + if (registryLocation == String.Empty) { - loader.Load("/OpenSim/Startup"); - m_plugins = loader.Plugins; + using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this))) + { + loader.Load("/OpenSim/Startup"); + m_plugins = loader.Plugins; + } + } + else + { + using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this), registryLocation)) + { + loader.Load("/OpenSim/Startup"); + m_plugins = loader.Plugins; + } } } @@ -1052,4 +1066,4 @@ namespace OpenSim { public IConfigSource Source; } -} \ No newline at end of file +}