Skip to content

Commit

Permalink
Found that xWebVirtualDirectory does not like a leading slash in it's…
Browse files Browse the repository at this point in the history
… name, so the leading slash was removed for this and xWebApplication (xWebApplication seems happy either way). Also added whitespace between AppPools.
  • Loading branch information
kevinsea committed Aug 21, 2016
1 parent b1597be commit 03b59b1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion DesiredStateGenerator/IIS/ApplicationDesiredState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ private void Initialize(Application application, string siteKey, string siteName
this.Key = GetApplicationVariableName(siteName, application.Path);
this.IsRootApplication = (application.Path == "/");

AddAttribute("Name", application.Path);
string name = application.Path.StartsWith("/") ? application.Path.Substring(1) : application.Path;
AddAttribute("Name", name);

AddAttribute("Ensure", "Present");
AddAttribute("Website", siteName);
AddAttribute("PhysicalPath", application.VirtualDirectories[0].PhysicalPath);
Expand Down
3 changes: 2 additions & 1 deletion DesiredStateGenerator/IIS/IISCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public string GenerateCode(IisPoolAndSitesOptions options)

if (options.StandardizeAppPoolRecycles)
sb.AppendLine(baseIndent + @"$appPoolRecycleHour = '02'");

sb.AppendLine(baseIndent);

if (options.IisPoolAndSitesGenerationMode == IisPoolAndSitesGenerationMode.ConfigFileOrder)
Expand Down Expand Up @@ -128,7 +129,7 @@ private string GenerateSitesAndPools(IEnumerable<SiteDesiredState> siteList
if (poolToGenerate != null)
{
code = GeneratePool(poolToGenerate);
sb.Append(code);
sb.AppendLine(code);

poolsLeftToGenerate.Remove(poolToGenerate);
}
Expand Down
3 changes: 0 additions & 3 deletions DesiredStateGenerator/IIS/PoolDesiredState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ private void Initialize(ApplicationPool iisPoolObject, IISCodeGenerator.IisPoolA
{
string recycleTime = "$appPoolRecycleHour+':00:00'";//.Replace("'", "\"");
this.AddAttributeWithOverrideValue("RestartSchedule", $"@({recycleTime})", GetScheduleString(iisPoolObject));

// this.AddAttributeWithOverrideValue("RestartSchedule", "@('02:00:00')", GetScheduleString(iisPoolObject));

}
else
{
Expand Down
3 changes: 2 additions & 1 deletion DesiredStateGenerator/IIS/VirtualDirectoryDesiredState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ private void Initialize(VirtualDirectory virtualDirectory, string siteName, stri

this.IsRootOfAnApplication = (virtualDirectory.Path == "/");

AddAttribute("Name", virtualDirectory.Path);
string name = virtualDirectory.Path.StartsWith("/") ? virtualDirectory.Path.Substring(1) : virtualDirectory.Path;
AddAttribute("Name", name);

AddAttribute("Ensure", "Present");
AddAttribute("Website", siteName);
Expand Down
4 changes: 2 additions & 2 deletions DesiredStateGenerator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.1")]
[assembly: AssemblyFileVersion("2.0.1")]
[assembly: AssemblyVersion("2.0.3")]
[assembly: AssemblyFileVersion("2.0.3")]

0 comments on commit 03b59b1

Please sign in to comment.