{
lock (channelTemplates) {
if (!defaultConfigRead) {
+ var bundled = Environment.GetBundledMachineConfig ();
+ if (bundled != null)
+ ReadConfigString (bundled);
+
if (File.Exists (Environment.GetMachineConfigPath ()))
ReadConfigFile (Environment.GetMachineConfigPath ());
defaultConfigRead = true;
Configure (filename, false);
}
+ private static void ReadConfigString (string filename)
+ {
+ try
+ {
+ SmallXmlParser parser = new SmallXmlParser ();
+ using (TextReader rreader = new StringReader (filename)) {
+ ConfigHandler handler = new ConfigHandler (false);
+ parser.Parse (rreader, handler);
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new RemotingException ("Configuration string could not be loaded: " + ex.Message, ex);
+ }
+ }
+
private static void ReadConfigFile (string filename)
{
try
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern static int GetPageSize ();
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern private static string get_bundled_machine_config ();
+
+ internal static string GetBundledMachineConfig ()
+ {
+ return get_bundled_machine_config ();
+ }
+
static internal bool IsUnix {
get {
int platform = (int) Environment.Platform;
ICALL(ENV_14, "get_ProcessorCount", mono_cpu_count)
ICALL(ENV_15, "get_TickCount", ves_icall_System_Environment_get_TickCount)
ICALL(ENV_16, "get_UserName", ves_icall_System_Environment_get_UserName)
+HANDLES(ICALL(ENV_16b, "get_bundled_machine_config", get_bundled_machine_config))
ICALL(ENV_16m, "internalBroadcastSettingChange", ves_icall_System_Environment_BroadcastSettingChange)
HANDLES(ICALL(ENV_17, "internalGetEnvironmentVariable_native", ves_icall_System_Environment_GetEnvironmentVariable_native))
HANDLES(ICALL(ENV_18, "internalGetGacPath", ves_icall_System_Environment_GetGacPath))