Helicon Zoo: Ignore web configuration errors if Zoo is not installed
This commit is contained in:
parent
9204eba68a
commit
bf9f1c815f
1 changed files with 36 additions and 40 deletions
|
@ -675,52 +675,48 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects
|
||||||
//
|
//
|
||||||
foreach (var item in iisObject.Applications)
|
foreach (var item in iisObject.Applications)
|
||||||
{
|
{
|
||||||
|
Configuration cfg = item.GetWebConfiguration();
|
||||||
|
string location = siteId + ConfigurationUtility.GetQualifiedVirtualPath(item.Path);
|
||||||
|
ConfigurationSection section;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
section = cfg.GetSection("system.webServer/heliconZoo", location);
|
||||||
Configuration cfg = item.GetWebConfiguration();
|
|
||||||
string location = siteId + ConfigurationUtility.GetQualifiedVirtualPath(item.Path);
|
|
||||||
ConfigurationSection section = cfg.GetSection("system.webServer/heliconZoo", location);
|
|
||||||
|
|
||||||
if (section.GetCollection().Count > 0)
|
|
||||||
{
|
|
||||||
WebVirtualDirectory vdir = new WebVirtualDirectory
|
|
||||||
{
|
|
||||||
Name = ConfigurationUtility.GetNonQualifiedVirtualPath(item.Path),
|
|
||||||
ContentPath = item.VirtualDirectories[0].PhysicalPath
|
|
||||||
};
|
|
||||||
|
|
||||||
ConfigurationElement zooAppElement = section.GetCollection()[0];
|
|
||||||
ConfigurationElementCollection envColl = zooAppElement.GetChildElement("environmentVariables").GetCollection();
|
|
||||||
|
|
||||||
foreach (ConfigurationElement env in envColl)
|
|
||||||
{
|
|
||||||
if ((string) env.GetAttributeValue("name") == "CONSOLE_URL")
|
|
||||||
{
|
|
||||||
vdir.ConsoleUrl = ConfigurationUtility.GetQualifiedVirtualPath(item.Path);
|
|
||||||
if (!vdir.ConsoleUrl.EndsWith("/"))
|
|
||||||
{
|
|
||||||
vdir.ConsoleUrl += "/";
|
|
||||||
}
|
|
||||||
vdir.ConsoleUrl += (string)env.GetAttributeValue("value");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vdirs.Add(vdir);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch(Exception)
|
||||||
{
|
{
|
||||||
//there is no zoo
|
// looks like Helicon Zoo is not installed, return empty array
|
||||||
throw;
|
return vdirs.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section.GetCollection().Count > 0)
|
||||||
|
{
|
||||||
|
WebVirtualDirectory vdir = new WebVirtualDirectory
|
||||||
|
{
|
||||||
|
Name = ConfigurationUtility.GetNonQualifiedVirtualPath(item.Path),
|
||||||
|
ContentPath = item.VirtualDirectories[0].PhysicalPath
|
||||||
|
};
|
||||||
|
|
||||||
|
ConfigurationElement zooAppElement = section.GetCollection()[0];
|
||||||
|
ConfigurationElementCollection envColl = zooAppElement.GetChildElement("environmentVariables").GetCollection();
|
||||||
|
|
||||||
|
foreach (ConfigurationElement env in envColl)
|
||||||
|
{
|
||||||
|
if ((string) env.GetAttributeValue("name") == "CONSOLE_URL")
|
||||||
|
{
|
||||||
|
vdir.ConsoleUrl = ConfigurationUtility.GetQualifiedVirtualPath(item.Path);
|
||||||
|
if (!vdir.ConsoleUrl.EndsWith("/"))
|
||||||
|
{
|
||||||
|
vdir.ConsoleUrl += "/";
|
||||||
|
}
|
||||||
|
vdir.ConsoleUrl += (string)env.GetAttributeValue("value");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vdirs.Add(vdir);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
return vdirs.ToArray();
|
return vdirs.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue