From db758b9f85e288a6f14e00f35cbeab1235ed4bd6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pablo=20Ruiz=20Garc=C3=ADa?= Date: Mon, 12 Jun 2017 01:55:26 +0200 Subject: [PATCH] Fix OpenMappedWebConfiguration throws: System.IndexOutOfRangeException, when using RazorGenerator under mono (#5013) --- .../System.Web.Configuration_2.0/WebConfigurationHost.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationHost.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationHost.cs index 8f9aff4d0fd..85942d311a4 100644 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationHost.cs +++ b/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationHost.cs @@ -174,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; -- 2.25.1