SitecorePowerShell / Console

Sitecore PowerShell Extensions
https://doc.sitecorepowershell.com/
Other
114 stars 70 forks source link

Cannot run scripts if LogFolder is set to Absolute Path #837

Closed vXSovereignXv closed 7 years ago

vXSovereignXv commented 7 years ago

There is an issue running scripts when the LogFolder setting is set to an absolute path instead of relative to the dataFolder path. By default the LogFolder is set to $(dataFolder)/logs however we write all of our logs to a separate drive which requires the use of an absolute path ie: F:/My-SitecoreSite-Logs.

We're currently using Sitecore PowerShell Extensions-4.3 for Sitecore 8.

This is the error I recieve when attempting to run a script

Nested Exception

Exception: System.Web.HttpException
Message: 'F:/My-SitecoreSite-Logs' is a physical path, but a virtual path was expected.
Source: System.Web
   at System.Web.Util.UrlPath.CheckValidVirtualPath(String path)
   at System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative)
   at System.Web.VirtualPath.Combine(VirtualPath relativePath)
   at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)
   at System.Web.HttpServerUtility.MapPath(String path)
   at Cognifide.PowerShell.Core.Settings.PredefinedVariables..cctor()

My current workaround is setting LogFolder back to $(dataFolder)/logs when I need to run a script.

AdamNaj commented 7 years ago

Fixed.