The web.config file needs to have Windows slashes even if published on *nix

Addresses #104
This commit is contained in:
moozzyk 2016-04-12 16:37:38 -07:00
parent 559b314348
commit 362c093174
3 changed files with 7 additions and 5 deletions

View File

@ -57,8 +57,10 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.Tools
private static void TransformAspNetCore(XElement aspNetCoreElement, string appName, bool configureForAzure) private static void TransformAspNetCore(XElement aspNetCoreElement, string appName, bool configureForAzure)
{ {
var appPath = Path.Combine(configureForAzure ? @"%home%\site" : ".", appName); // Forward slashes currently work neither in AspNetCoreModule nor in dotnet so they need to be
var logPath = Path.Combine(configureForAzure ? @"\\?\%home%\LogFiles" : @".\logs", "stdout.log"); // replaced with backwards slashes when the application is published on a non-Windows machine
var appPath = Path.Combine(configureForAzure ? @"%home%\site" : ".", appName).Replace("/", "\\");
var logPath = Path.Combine(configureForAzure ? @"\\?\%home%\LogFiles" : @".\logs", "stdout.log").Replace("/", "\\");
aspNetCoreElement.SetAttributeValue("processPath", appPath); aspNetCoreElement.SetAttributeValue("processPath", appPath);
SetAttributeValueIfEmpty(aspNetCoreElement, "stdoutLogEnabled", "false"); SetAttributeValueIfEmpty(aspNetCoreElement, "stdoutLogEnabled", "false");

View File

@ -25,7 +25,7 @@
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": { "Microsoft.NETCore.App": {
"type": "platform", "type": "platform",
"version": "1.0.0-*" "version": "1.0.0-rc2-23931"
} }
} }
} }

View File

@ -57,8 +57,8 @@ namespace Microsoft.AspNetCore.Tools.PublishIIS
private static void TransformHttpPlatform(XElement httpPlatformElement, string appName, bool configureForAzure) private static void TransformHttpPlatform(XElement httpPlatformElement, string appName, bool configureForAzure)
{ {
var appPath = Path.Combine(configureForAzure ? @"%home%\site" : "..", appName); var appPath = Path.Combine(configureForAzure ? @"%home%\site" : "..", appName).Replace("/", "\\");
var logPath = Path.Combine(configureForAzure ? @"\\?\%home%\LogFiles" : @"..\logs", "stdout.log"); var logPath = Path.Combine(configureForAzure ? @"\\?\%home%\LogFiles" : @"..\logs", "stdout.log").Replace("/", "\\");
httpPlatformElement.SetAttributeValue("processPath", appPath); httpPlatformElement.SetAttributeValue("processPath", appPath);
SetAttributeValueIfEmpty(httpPlatformElement, "stdoutLogEnabled", "false"); SetAttributeValueIfEmpty(httpPlatformElement, "stdoutLogEnabled", "false");