temp code
This commit is contained in:
@@ -93,6 +93,7 @@ namespace Umbraco.Web.Strategies
|
||||
{
|
||||
try
|
||||
{
|
||||
//var asdf = GetBindings(httpContext);
|
||||
var address = httpContext.Request.Url.GetLeftPart(UriPartial.Authority);
|
||||
applicationContext.Services.ServerRegistrationService.EnsureActive(address);
|
||||
}
|
||||
@@ -101,5 +102,40 @@ namespace Umbraco.Web.Strategies
|
||||
LogHelper.Error<ServerRegistrationEventHandler>("Failed to update server record in database.", e);
|
||||
}
|
||||
}
|
||||
|
||||
//private static IEnumerable<KeyValuePair<string, string>> GetBindings(HttpContextBase context)
|
||||
//{
|
||||
// // Get the Site name
|
||||
// string siteName = System.Web.Hosting.HostingEnvironment.SiteName;
|
||||
|
||||
// // Get the sites section from the AppPool.config
|
||||
// Microsoft.Web.Administration.ConfigurationSection sitesSection =
|
||||
// Microsoft.Web.Administration.WebConfigurationManager.GetSection(null, null, "system.applicationHost/sites");
|
||||
|
||||
// foreach (Microsoft.Web.Administration.ConfigurationElement site in sitesSection.GetCollection())
|
||||
// {
|
||||
// // Find the right Site
|
||||
// if (String.Equals((string)site["name"], siteName, StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
|
||||
// // For each binding see if they are http based and return the port and protocol
|
||||
// foreach (Microsoft.Web.Administration.ConfigurationElement binding in site.GetCollection("bindings"))
|
||||
// {
|
||||
// string protocol = (string)binding["protocol"];
|
||||
// string bindingInfo = (string)binding["bindingInformation"];
|
||||
|
||||
// if (protocol.StartsWith("http", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// string[] parts = bindingInfo.Split(':');
|
||||
// if (parts.Length == 3)
|
||||
// {
|
||||
// string port = parts[1];
|
||||
// yield return new KeyValuePair<string, string>(protocol, port);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +117,10 @@
|
||||
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.Web.Administration.7.0.0.0\lib\net20\Microsoft.Web.Administration.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
|
||||
Reference in New Issue
Block a user