Browse Source

2004-05-04 Gonzalo Paniagua Javier <[email protected]>

	* WebConfigurationSettings.cs: now it defaults to 'web.config' and if
	not found, 'Web.config'. Don't throw exception if both exists. Thanks
	to urs and dru for bugging me about this.

svn path=/trunk/mcs/; revision=26698
Gonzalo Paniagua Javier 21 years ago
parent
commit
b5d55265c2

+ 6 - 0
mcs/class/System.Web/System.Web.Configuration/ChangeLog

@@ -1,3 +1,9 @@
+2004-05-04  Gonzalo Paniagua Javier <[email protected]>
+
+	* WebConfigurationSettings.cs: now it defaults to 'web.config' and if
+	not found, 'Web.config'. Don't throw exception if both exists. Thanks
+	to urs and dru for bugging me about this.
+
 2004-04-22  Gonzalo Paniagua Javier <[email protected]>
 
 	* WebConfigurationSettings.cs: fixed argument exception if the directory

+ 10 - 10
mcs/class/System.Web/System.Web.Configuration/WebConfigurationSettings.cs

@@ -146,17 +146,17 @@ namespace System.Web.Configuration
 
 			string realpath = context.Request.MapPath (dir);
 			string lower = Path.Combine (realpath, "web.config");
-			string upper = Path.Combine (realpath, "Web.config");
-			bool isUpper = File.Exists (upper);
-			// This is a workaround for bug #56938
-			// '\\' checks whether environment is Windows or not
-			bool isLower = (Path.DirectorySeparatorChar == '\\') ? false : File.Exists (lower);
-			if (isUpper && isLower && Directory.GetFiles (realpath, "Web.config").Length < 2)
-				throw new ConfigurationException ("Both web.config and Web.config exist for " + dir);
-
-			//
+			bool isLower = File.Exists (lower);
+			string wcfile = null;
+			if (!isLower) {
+				string upper = Path.Combine (realpath, "Web.config");
+				bool isUpper = File.Exists (upper);
+				if (isUpper)
+					wcfile = upper;
+			} else {
+				wcfile = lower;
+			}
 
-			string wcfile = (isUpper) ? upper : (isLower) ? lower : null;
 			string tempDir = dir;
 			if (tempDir == HttpRuntime.AppDomainAppVirtualPath ||
 			    tempDir + "/" == HttpRuntime.AppDomainAppVirtualPath) {