Merge pull request #4967 from kumpera/profiler-arg-cleanup
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / WebConfigurationHost.cs
index 8b1474f9c69f9135967e65c12fc787b8b8a49619..85942d311a41401ea76c73d6ac30d9fde70dd1c4 100644 (file)
@@ -27,7 +27,6 @@
 // Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 
-#if NET_2_0
 
 using System;
 using System.Collections;
@@ -175,7 +174,11 @@ namespace System.Web.Configuration
                {
                        string fullPath = (string) hostInitConfigurationParams [1];
                        map = (WebConfigurationFileMap) hostInitConfigurationParams [0];
-                       bool inAnotherApp = (bool) hostInitConfigurationParams [7];
+                       bool inAnotherApp = false;
+
+                       if ((hostInitConfigurationParams.Length > 7)
+                               && (hostInitConfigurationParams[7] is bool))
+                               inAnotherApp = (bool) hostInitConfigurationParams[7];
 
                        if (inAnotherApp)
                                appVirtualPath = fullPath;
@@ -491,4 +494,3 @@ namespace System.Web.Configuration
        }
 }
 
-#endif