EPiServer.Logging.Log4Net uses invalid path in powershell script

Found in

EPiServer.Logging.Log4Net 2.2.0

Created

Nov 05 2017

Updated

Nov 06 2017

Area

CMS Core

State

Closed, Duplicate

Voting

Affected? You can raise the priority of a bug by voting for it. By doing so, you will be helping our developers to choose which bug to fix next.

Voting is disabled for closed bugs.

0

Description

EPiServer.Logging.Log4Net.2.2.0-pre-000019 fails to set binding redirects.

Steps:

create Episerver MVC Alloy site using VS Extension, target framework 4.7
update NuGet packages to the pre-release (currently the update 186, Pre-release packages for Episerver CMS 11.1)
EPiServer.Logging.Log4Net.2.2.0-pre-000019 package creates error:

Executing script file 'X:[MY-PATH-TO-PROJECT]\packages\EPiServer.Logging.Log4Net.2.2.0-pre-000019\tools\Install.ps1'...
get-childItem : Cannot find path 'X:[MY-PATH-TO-PROJECT]\packages\EPiServer.Logging.Log4Net.2.2.0-pre-000019\lib\net45' because it does not exist.
At X:[MY-PATH-TO-PROJECT]\packages\EPiServer.Logging.Log4Net.2.2.0-pre-000019\tools\Install.ps1:124 char:1
+ get-childItem "$libPath*.dll" | % { AddOrUpdateBindingRedirect $_ $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (X:[MY-PATH-TO-PROJECT]\...00019\lib\net45:String) [Get-ChildItem], ItemNotFound
Exception
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Successfully installed 'EPiServer.Logging.Log4Net 2.2.0-pre-000019' to Website

The package lib-folder has only folder net461 and the Install.ps1 file has hardcoded:

$libPath = join-path $installPath "lib\net45"

Reported here:

http://world.episerver.com/forum/developer-forum/Installation-and-security/Thread-Container/2017/11/nuget-package-episerver.logging.log4net.2.2.0-pre-000019-install.ps1-is-using-wrong-libpath-value/

Comments