Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2016-04-20 09:09:32 +0300
committerMarek Safar <marek.safar@gmail.com>2016-04-20 09:09:32 +0300
commit26b4a3d856d55b7ac2148bccaec298c5c720992c (patch)
tree97812b3a89df314f39b34d1cca086abcd81ada3b /mcs/class/System.Configuration
parentcbf9ddad25de50c1d9dcb8ec39fb4e081982d84a (diff)
parentfee605ccc5d330dc01bc2570b994af3a612382d5 (diff)
Merge pull request #2891 from xmcclure/bug-39669
Allow xml configuration sections to reference System.dll (bug#39669)
Diffstat (limited to 'mcs/class/System.Configuration')
-rw-r--r--mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs5
-rw-r--r--mcs/class/System.Configuration/Test/standalone/Makefile2
-rw-r--r--mcs/class/System.Configuration/Test/standalone/t48.cs24
-rw-r--r--mcs/class/System.Configuration/Test/standalone/t48.exe.config10
-rw-r--r--mcs/class/System.Configuration/Test/standalone/t48.exe.expected0
5 files changed, 40 insertions, 1 deletions
diff --git a/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs b/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs
index e4d59f1466c..0cf6136ae38 100644
--- a/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs
+++ b/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs
@@ -69,6 +69,11 @@ namespace System.Configuration
public virtual Type GetConfigType (string typeName, bool throwOnError)
{
Type type = Type.GetType (typeName);
+
+ // This code is in System.Configuration.dll, but some of the classes we might want to load here are in System.dll.
+ if (type == null)
+ type = Type.GetType (typeName + ",System");
+
if (type == null && throwOnError)
throw new ConfigurationErrorsException ("Type '" + typeName + "' not found.");
return type;
diff --git a/mcs/class/System.Configuration/Test/standalone/Makefile b/mcs/class/System.Configuration/Test/standalone/Makefile
index 1684d1c5e2d..b203b7b9099 100644
--- a/mcs/class/System.Configuration/Test/standalone/Makefile
+++ b/mcs/class/System.Configuration/Test/standalone/Makefile
@@ -2,7 +2,7 @@ thisdir = class/System.Configuration/Test/standalone
SUBDIRS =
include ../../../../build/rules.make
-TESTS = t1.exe t2.exe t3.exe t4.exe t5.exe t6.exe t7.exe t8.exe t9.exe t10.exe t11.exe t12.exe t15.exe t16.exe t17.exe t18.exe t19.exe t20.exe t21.exe t22.exe t23.exe t24.exe t25.exe t28.exe t29.exe t30.exe t31.exe t32.exe t33.exe t34.exe t35.exe t36.exe t37.exe t38.exe t39.exe t40.exe t41.exe t42.exe t43.exe t44.exe t45.exe t46.exe t47.exe
+TESTS = t1.exe t2.exe t3.exe t4.exe t5.exe t6.exe t7.exe t8.exe t9.exe t10.exe t11.exe t12.exe t15.exe t16.exe t17.exe t18.exe t19.exe t20.exe t21.exe t22.exe t23.exe t24.exe t25.exe t28.exe t29.exe t30.exe t31.exe t32.exe t33.exe t34.exe t35.exe t36.exe t37.exe t38.exe t39.exe t40.exe t41.exe t42.exe t43.exe t44.exe t45.exe t46.exe t47.exe t48.exe
# t13.exe t14.exe t26.exe t27.exe
check: local compare
diff --git a/mcs/class/System.Configuration/Test/standalone/t48.cs b/mcs/class/System.Configuration/Test/standalone/t48.cs
new file mode 100644
index 00000000000..6d7bc05f3b3
--- /dev/null
+++ b/mcs/class/System.Configuration/Test/standalone/t48.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections;
+
+// Bugzilla #39669
+
+namespace TestConfigSection
+{
+ class Test
+ {
+ public static int Main (string[] args)
+ {
+ Hashtable testCustomSection = (Hashtable)System.Configuration.ConfigurationManager.GetSection ("TestCustomSection");
+ string proxyServer = (string)testCustomSection["ProxyServer"];
+
+ if (proxyServer == null)
+ throw new Exception("Custom section value is null");
+
+ if (proxyServer != "server.example.com")
+ throw new Exception("Custom section value is incorrect");
+
+ return 0;
+ }
+ }
+}
diff --git a/mcs/class/System.Configuration/Test/standalone/t48.exe.config b/mcs/class/System.Configuration/Test/standalone/t48.exe.config
new file mode 100644
index 00000000000..ebdf8a8e610
--- /dev/null
+++ b/mcs/class/System.Configuration/Test/standalone/t48.exe.config
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <configSections>
+ <section name="TestCustomSection" type="System.Configuration.DictionarySectionHandler" />
+ </configSections>
+ <TestCustomSection>
+ <add key="ProxyServer" value="server.example.com" />
+ <add key="ConnectOnStart" value="false" />
+ </TestCustomSection>
+</configuration> \ No newline at end of file
diff --git a/mcs/class/System.Configuration/Test/standalone/t48.exe.expected b/mcs/class/System.Configuration/Test/standalone/t48.exe.expected
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/mcs/class/System.Configuration/Test/standalone/t48.exe.expected