diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration.Tools/PublishIISCommand.cs b/src/Microsoft.AspNetCore.Server.IISIntegration.Tools/PublishIISCommand.cs index eea405c817..6ead3cf364 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration.Tools/PublishIISCommand.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration.Tools/PublishIISCommand.cs @@ -91,7 +91,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools } var builder = new ConfigurationBuilder() - .AddJsonFile(Path.Combine(applicationBasePath, "hosting.json"), optional: true); + .SetBasePath(applicationBasePath) + .AddJsonFile("hosting.json", optional: true); var webroot = builder.Build()["webroot"]; diff --git a/src/dotnet-publish-iis/PublishIISCommand.cs b/src/dotnet-publish-iis/PublishIISCommand.cs index c2d7aa83f1..6bb3f66d76 100644 --- a/src/dotnet-publish-iis/PublishIISCommand.cs +++ b/src/dotnet-publish-iis/PublishIISCommand.cs @@ -91,7 +91,8 @@ namespace Microsoft.AspNetCore.Tools.PublishIIS } var builder = new ConfigurationBuilder() - .AddJsonFile(Path.Combine(applicationBasePath, "hosting.json"), optional: true); + .SetBasePath(applicationBasePath) + .AddJsonFile("hosting.json", optional: true); var webroot = builder.Build()["webroot"];