Skip to content

Commit 8d86169

Browse files
committed
Pulling in change https://github.com/mono/mono/pull/12008/files which removes the registry as a dependecy for system.xml
1 parent 6e40bbb commit 8d86169

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReaderSettings.cs

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -729,47 +729,10 @@ static internal bool EnableLegacyXmlSettings()
729729
return s_enableLegacyXmlSettings.Value;
730730
}
731731

732-
bool enableSettings = false; // default value
733-
#if !MOBILE
734-
if (!ReadSettingsFromRegistry(Registry.LocalMachine, ref enableSettings))
735-
{
736-
// still ok if this call return false too as we'll use the default value which is false
737-
ReadSettingsFromRegistry(Registry.CurrentUser, ref enableSettings);
738-
}
739-
#endif
740-
741-
s_enableLegacyXmlSettings = enableSettings;
732+
s_enableLegacyXmlSettings = false;
742733
return s_enableLegacyXmlSettings.Value;
743734
}
744735

745-
#if !MOBILE
746-
[RegistryPermission(SecurityAction.Assert, Unrestricted = true)]
747-
[SecuritySafeCritical]
748-
private static bool ReadSettingsFromRegistry(RegistryKey hive, ref bool value)
749-
{
750-
const string regValueName = "EnableLegacyXmlSettings";
751-
const string regValuePath = @"SOFTWARE\Microsoft\.NETFramework\XML";
752-
753-
try
754-
{
755-
using (RegistryKey xmlRegKey = hive.OpenSubKey(regValuePath, false))
756-
{
757-
if (xmlRegKey != null)
758-
{
759-
if (xmlRegKey.GetValueKind(regValueName) == RegistryValueKind.DWord)
760-
{
761-
value = ((int)xmlRegKey.GetValue(regValueName)) == 1;
762-
return true;
763-
}
764-
}
765-
}
766-
}
767-
catch { /* use the default if we couldn't read the key */ }
768-
769-
return false;
770-
}
771-
#endif // MOBILE
772-
773736
#endif // SILVERLIGHT
774737

775738
}

0 commit comments

Comments
 (0)