Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Commit

Permalink
The web.config file needs to have Windows slashes even if published o…
Browse files Browse the repository at this point in the history
…n *nix

Addresses #104
  • Loading branch information
moozzyk committed Apr 12, 2016
1 parent 1441dbc commit ca37935
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ private static void TransformHandlers(XElement handlersElement)

private static void TransformAspNetCore(XElement aspNetCoreElement, string appName, bool configureForAzure)
{
var appPath = Path.Combine(configureForAzure ? @"%home%\site" : ".", appName);
var logPath = Path.Combine(configureForAzure ? @"\\?\%home%\LogFiles" : @".\logs", "stdout.log");
// Forward slashes currently work neither in AspNetCoreModule nor in dotnet so they need to be
// 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);
SetAttributeValueIfEmpty(aspNetCoreElement, "stdoutLogEnabled", "false");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-*"
"version": "1.0.0-rc2-23931"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/dotnet-publish-iis/WebConfigTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ private static void TransformHandlers(XElement handlersElement)

private static void TransformHttpPlatform(XElement httpPlatformElement, string appName, bool configureForAzure)
{
var appPath = Path.Combine(configureForAzure ? @"%home%\site" : "..", appName);
var logPath = Path.Combine(configureForAzure ? @"\\?\%home%\LogFiles" : @"..\logs", "stdout.log");
var appPath = Path.Combine(configureForAzure ? @"%home%\site" : "..", appName).Replace("/", "\\");
var logPath = Path.Combine(configureForAzure ? @"\\?\%home%\LogFiles" : @"..\logs", "stdout.log").Replace("/", "\\");

httpPlatformElement.SetAttributeValue("processPath", appPath);
SetAttributeValueIfEmpty(httpPlatformElement, "stdoutLogEnabled", "false");
Expand Down

0 comments on commit ca37935

Please sign in to comment.